<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">

<title>class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter - Rails Framework Documentation</title>

<link type="text/css" media="screen" href="../../rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "../../";
</script>

<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="../../js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="../../index.html">Home</a>
    <a href="../../table_of_contents.html#classes">Classes</a>
    <a href="../../table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>/usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link">AbstractAdapter
  
</nav>

    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-c-new">::new</a>
    
    <li><a href="#method-i-active-3F">#active?</a>
    
    <li><a href="#method-i-adapter_name">#adapter_name</a>
    
    <li><a href="#method-i-add_column">#add_column</a>
    
    <li><a href="#method-i-begin_db_transaction">#begin_db_transaction</a>
    
    <li><a href="#method-i-change_column">#change_column</a>
    
    <li><a href="#method-i-change_column_default">#change_column_default</a>
    
    <li><a href="#method-i-change_column_null">#change_column_null</a>
    
    <li><a href="#method-i-clear_cache-21">#clear_cache!</a>
    
    <li><a href="#method-i-client_min_messages">#client_min_messages</a>
    
    <li><a href="#method-i-client_min_messages-3D">#client_min_messages=</a>
    
    <li><a href="#method-i-columns">#columns</a>
    
    <li><a href="#method-i-commit_db_transaction">#commit_db_transaction</a>
    
    <li><a href="#method-i-create_database">#create_database</a>
    
    <li><a href="#method-i-create_savepoint">#create_savepoint</a>
    
    <li><a href="#method-i-current_database">#current_database</a>
    
    <li><a href="#method-i-current_schema">#current_schema</a>
    
    <li><a href="#method-i-disconnect-21">#disconnect!</a>
    
    <li><a href="#method-i-encoding">#encoding</a>
    
    <li><a href="#method-i-escape_bytea">#escape_bytea</a>
    
    <li><a href="#method-i-exec_delete">#exec_delete</a>
    
    <li><a href="#method-i-exec_query">#exec_query</a>
    
    <li><a href="#method-i-exec_update">#exec_update</a>
    
    <li><a href="#method-i-execute">#execute</a>
    
    <li><a href="#method-i-explain">#explain</a>
    
    <li><a href="#method-i-index_name_length">#index_name_length</a>
    
    <li><a href="#method-i-indexes">#indexes</a>
    
    <li><a href="#method-i-insert_sql">#insert_sql</a>
    
    <li><a href="#method-i-outside_transaction-3F">#outside_transaction?</a>
    
    <li><a href="#method-i-postgresql_version">#postgresql_version</a>
    
    <li><a href="#method-i-primary_key">#primary_key</a>
    
    <li><a href="#method-i-quote_table_name">#quote_table_name</a>
    
    <li><a href="#method-i-reconnect-21">#reconnect!</a>
    
    <li><a href="#method-i-release_savepoint">#release_savepoint</a>
    
    <li><a href="#method-i-rename_column">#rename_column</a>
    
    <li><a href="#method-i-rename_index">#rename_index</a>
    
    <li><a href="#method-i-rename_table">#rename_table</a>
    
    <li><a href="#method-i-reset-21">#reset!</a>
    
    <li><a href="#method-i-rollback_db_transaction">#rollback_db_transaction</a>
    
    <li><a href="#method-i-rollback_to_savepoint">#rollback_to_savepoint</a>
    
    <li><a href="#method-i-schema_exists-3F">#schema_exists?</a>
    
    <li><a href="#method-i-schema_search_path">#schema_search_path</a>
    
    <li><a href="#method-i-schema_search_path-3D">#schema_search_path=</a>
    
    <li><a href="#method-i-select_rows">#select_rows</a>
    
    <li><a href="#method-i-serial_sequence">#serial_sequence</a>
    
    <li><a href="#method-i-session_auth-3D">#session_auth=</a>
    
    <li><a href="#method-i-set_standard_conforming_strings">#set_standard_conforming_strings</a>
    
    <li><a href="#method-i-sql_for_insert">#sql_for_insert</a>
    
    <li><a href="#method-i-substitute_at">#substitute_at</a>
    
    <li><a href="#method-i-supports_ddl_transactions-3F">#supports_ddl_transactions?</a>
    
    <li><a href="#method-i-supports_explain-3F">#supports_explain?</a>
    
    <li><a href="#method-i-supports_index_sort_order-3F">#supports_index_sort_order?</a>
    
    <li><a href="#method-i-supports_insert_with_returning-3F">#supports_insert_with_returning?</a>
    
    <li><a href="#method-i-supports_migrations-3F">#supports_migrations?</a>
    
    <li><a href="#method-i-supports_savepoints-3F">#supports_savepoints?</a>
    
    <li><a href="#method-i-supports_statement_cache-3F">#supports_statement_cache?</a>
    
    <li><a href="#method-i-table_alias_length">#table_alias_length</a>
    
    <li><a href="#method-i-table_exists-3F">#table_exists?</a>
    
    <li><a href="#method-i-tables">#tables</a>
    
    <li><a href="#method-i-translate_exception">#translate_exception</a>
    
    <li><a href="#method-i-type_cast">#type_cast</a>
    
    <li><a href="#method-i-type_to_sql">#type_to_sql</a>
    
    <li><a href="#method-i-unescape_bytea">#unescape_bytea</a>
    
    <li><a href="#method-i-update_sql">#update_sql</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionmailer-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionmailer-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionpack-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/actionpack-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activemodel-3_2_7/MIT-LICENSE.html">MIT-LICENSE</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activemodel-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activerecord-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activeresource-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/activesupport-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../..//usr/local/lib/ruby/gems/1_9_1/gems/railties-3_2_7/README_rdoc.html">README</a>
  
    <li class="file"><a href="../../README_rdoc.html">README</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="../../ActiveRecord.html">ActiveRecord</a>
  
    <li><a href="../../ActiveRecord/ActiveRecordError.html">ActiveRecord::ActiveRecordError</a>
  
    <li><a href="../../ActiveRecord/AdapterNotFound.html">ActiveRecord::AdapterNotFound</a>
  
    <li><a href="../../ActiveRecord/AdapterNotSpecified.html">ActiveRecord::AdapterNotSpecified</a>
  
    <li><a href="../../ActiveRecord/Aggregations.html">ActiveRecord::Aggregations</a>
  
    <li><a href="../../ActiveRecord/Aggregations/ClassMethods.html">ActiveRecord::Aggregations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AssociationTypeMismatch.html">ActiveRecord::AssociationTypeMismatch</a>
  
    <li><a href="../../ActiveRecord/Associations.html">ActiveRecord::Associations</a>
  
    <li><a href="../../ActiveRecord/Associations/ClassMethods.html">ActiveRecord::Associations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignment.html">ActiveRecord::AttributeAssignment</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignment/ClassMethods.html">ActiveRecord::AttributeAssignment::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeAssignmentError.html">ActiveRecord::AttributeAssignmentError</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods.html">ActiveRecord::AttributeMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/BeforeTypeCast.html">ActiveRecord::AttributeMethods::BeforeTypeCast</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/ClassMethods.html">ActiveRecord::AttributeMethods::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/DeprecatedUnderscoreRead.html">ActiveRecord::AttributeMethods::DeprecatedUnderscoreRead</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/DeprecatedUnderscoreRead/ClassMethods.html">ActiveRecord::AttributeMethods::DeprecatedUnderscoreRead::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Dirty.html">ActiveRecord::AttributeMethods::Dirty</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/PrimaryKey.html">ActiveRecord::AttributeMethods::PrimaryKey</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/PrimaryKey/ClassMethods.html">ActiveRecord::AttributeMethods::PrimaryKey::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Query.html">ActiveRecord::AttributeMethods::Query</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Read.html">ActiveRecord::AttributeMethods::Read</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Read/ClassMethods.html">ActiveRecord::AttributeMethods::Read::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization.html">ActiveRecord::AttributeMethods::Serialization</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization/Attribute.html">ActiveRecord::AttributeMethods::Serialization::Attribute</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Serialization/ClassMethods.html">ActiveRecord::AttributeMethods::Serialization::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/TimeZoneConversion.html">ActiveRecord::AttributeMethods::TimeZoneConversion</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/TimeZoneConversion/ClassMethods.html">ActiveRecord::AttributeMethods::TimeZoneConversion::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Write.html">ActiveRecord::AttributeMethods::Write</a>
  
    <li><a href="../../ActiveRecord/AttributeMethods/Write/ClassMethods.html">ActiveRecord::AttributeMethods::Write::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/AutosaveAssociation.html">ActiveRecord::AutosaveAssociation</a>
  
    <li><a href="../../ActiveRecord/AutosaveAssociation/ClassMethods.html">ActiveRecord::AutosaveAssociation::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Base.html">ActiveRecord::Base</a>
  
    <li><a href="../../ActiveRecord/Batches.html">ActiveRecord::Batches</a>
  
    <li><a href="../../ActiveRecord/Calculations.html">ActiveRecord::Calculations</a>
  
    <li><a href="../../ActiveRecord/Callbacks.html">ActiveRecord::Callbacks</a>
  
    <li><a href="../../ActiveRecord/ConfigurationError.html">ActiveRecord::ConfigurationError</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/AbstractAdapter.html">ActiveRecord::ConnectionAdapters::AbstractAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/AbstractMysqlAdapter.html">ActiveRecord::ConnectionAdapters::AbstractMysqlAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionHandler.html">ActiveRecord::ConnectionAdapters::ConnectionHandler</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionManagement.html">ActiveRecord::ConnectionAdapters::ConnectionManagement</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/ConnectionPool.html">ActiveRecord::ConnectionAdapters::ConnectionPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/DatabaseLimits.html">ActiveRecord::ConnectionAdapters::DatabaseLimits</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/DatabaseStatements.html">ActiveRecord::ConnectionAdapters::DatabaseStatements</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Mysql2Adapter.html">ActiveRecord::ConnectionAdapters::Mysql2Adapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/MysqlAdapter.html">ActiveRecord::ConnectionAdapters::MysqlAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/MysqlAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::MysqlAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/TableDefinition.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLAdapter/Utils.html">ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Utils</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/PostgreSQLColumn.html">ActiveRecord::ConnectionAdapters::PostgreSQLColumn</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/QueryCache.html">ActiveRecord::ConnectionAdapters::QueryCache</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Quoting.html">ActiveRecord::ConnectionAdapters::Quoting</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/ExplainPrettyPrinter.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::ExplainPrettyPrinter</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/StatementPool.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SQLiteAdapter/Version.html">ActiveRecord::ConnectionAdapters::SQLiteAdapter::Version</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SchemaCache.html">ActiveRecord::ConnectionAdapters::SchemaCache</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/SchemaStatements.html">ActiveRecord::ConnectionAdapters::SchemaStatements</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/StatementPool.html">ActiveRecord::ConnectionAdapters::StatementPool</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/Table.html">ActiveRecord::ConnectionAdapters::Table</a>
  
    <li><a href="../../ActiveRecord/ConnectionAdapters/TableDefinition.html">ActiveRecord::ConnectionAdapters::TableDefinition</a>
  
    <li><a href="../../ActiveRecord/ConnectionNotEstablished.html">ActiveRecord::ConnectionNotEstablished</a>
  
    <li><a href="../../ActiveRecord/ConnectionTimeoutError.html">ActiveRecord::ConnectionTimeoutError</a>
  
    <li><a href="../../ActiveRecord/CounterCache.html">ActiveRecord::CounterCache</a>
  
    <li><a href="../../ActiveRecord/DangerousAttributeError.html">ActiveRecord::DangerousAttributeError</a>
  
    <li><a href="../../ActiveRecord/Delegation.html">ActiveRecord::Delegation</a>
  
    <li><a href="../../ActiveRecord/DynamicFinderMatch.html">ActiveRecord::DynamicFinderMatch</a>
  
    <li><a href="../../ActiveRecord/DynamicMatchers.html">ActiveRecord::DynamicMatchers</a>
  
    <li><a href="../../ActiveRecord/DynamicScopeMatch.html">ActiveRecord::DynamicScopeMatch</a>
  
    <li><a href="../../ActiveRecord/Explain.html">ActiveRecord::Explain</a>
  
    <li><a href="../../ActiveRecord/FinderMethods.html">ActiveRecord::FinderMethods</a>
  
    <li><a href="../../ActiveRecord/Fixtures.html">ActiveRecord::Fixtures</a>
  
    <li><a href="../../ActiveRecord/Fixtures/File.html">ActiveRecord::Fixtures::File</a>
  
    <li><a href="../../ActiveRecord/IdentityMap.html">ActiveRecord::IdentityMap</a>
  
    <li><a href="../../ActiveRecord/IdentityMap/Middleware.html">ActiveRecord::IdentityMap::Middleware</a>
  
    <li><a href="../../ActiveRecord/Inheritance.html">ActiveRecord::Inheritance</a>
  
    <li><a href="../../ActiveRecord/Inheritance/ClassMethods.html">ActiveRecord::Inheritance::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Integration.html">ActiveRecord::Integration</a>
  
    <li><a href="../../ActiveRecord/InvalidForeignKey.html">ActiveRecord::InvalidForeignKey</a>
  
    <li><a href="../../ActiveRecord/IrreversibleMigration.html">ActiveRecord::IrreversibleMigration</a>
  
    <li><a href="../../ActiveRecord/Locking.html">ActiveRecord::Locking</a>
  
    <li><a href="../../ActiveRecord/Locking/Optimistic.html">ActiveRecord::Locking::Optimistic</a>
  
    <li><a href="../../ActiveRecord/Locking/Optimistic/ClassMethods.html">ActiveRecord::Locking::Optimistic::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Locking/Pessimistic.html">ActiveRecord::Locking::Pessimistic</a>
  
    <li><a href="../../ActiveRecord/LogSubscriber.html">ActiveRecord::LogSubscriber</a>
  
    <li><a href="../../ActiveRecord/Migration.html">ActiveRecord::Migration</a>
  
    <li><a href="../../ActiveRecord/Migration/CommandRecorder.html">ActiveRecord::Migration::CommandRecorder</a>
  
    <li><a href="../../ActiveRecord/MigrationProxy.html">ActiveRecord::MigrationProxy</a>
  
    <li><a href="../../ActiveRecord/ModelSchema.html">ActiveRecord::ModelSchema</a>
  
    <li><a href="../../ActiveRecord/ModelSchema/ClassMethods.html">ActiveRecord::ModelSchema::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/MultiparameterAssignmentErrors.html">ActiveRecord::MultiparameterAssignmentErrors</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes.html">ActiveRecord::NestedAttributes</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes/ClassMethods.html">ActiveRecord::NestedAttributes::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/NestedAttributes/TooManyRecords.html">ActiveRecord::NestedAttributes::TooManyRecords</a>
  
    <li><a href="../../ActiveRecord/Observer.html">ActiveRecord::Observer</a>
  
    <li><a href="../../ActiveRecord/Persistence.html">ActiveRecord::Persistence</a>
  
    <li><a href="../../ActiveRecord/Persistence/ClassMethods.html">ActiveRecord::Persistence::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/PreparedStatementInvalid.html">ActiveRecord::PreparedStatementInvalid</a>
  
    <li><a href="../../ActiveRecord/QueryCache.html">ActiveRecord::QueryCache</a>
  
    <li><a href="../../ActiveRecord/QueryCache/ClassMethods.html">ActiveRecord::QueryCache::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/QueryMethods.html">ActiveRecord::QueryMethods</a>
  
    <li><a href="../../ActiveRecord/Querying.html">ActiveRecord::Querying</a>
  
    <li><a href="../../ActiveRecord/Railtie.html">ActiveRecord::Railtie</a>
  
    <li><a href="../../ActiveRecord/Railties.html">ActiveRecord::Railties</a>
  
    <li><a href="../../ActiveRecord/Railties/ControllerRuntime.html">ActiveRecord::Railties::ControllerRuntime</a>
  
    <li><a href="../../ActiveRecord/Railties/ControllerRuntime/ClassMethods.html">ActiveRecord::Railties::ControllerRuntime::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/ReadOnlyRecord.html">ActiveRecord::ReadOnlyRecord</a>
  
    <li><a href="../../ActiveRecord/ReadonlyAttributes.html">ActiveRecord::ReadonlyAttributes</a>
  
    <li><a href="../../ActiveRecord/ReadonlyAttributes/ClassMethods.html">ActiveRecord::ReadonlyAttributes::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/RecordInvalid.html">ActiveRecord::RecordInvalid</a>
  
    <li><a href="../../ActiveRecord/RecordNotFound.html">ActiveRecord::RecordNotFound</a>
  
    <li><a href="../../ActiveRecord/RecordNotSaved.html">ActiveRecord::RecordNotSaved</a>
  
    <li><a href="../../ActiveRecord/RecordNotUnique.html">ActiveRecord::RecordNotUnique</a>
  
    <li><a href="../../ActiveRecord/Reflection.html">ActiveRecord::Reflection</a>
  
    <li><a href="../../ActiveRecord/Reflection/ClassMethods.html">ActiveRecord::Reflection::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Reflection/MacroReflection.html">ActiveRecord::Reflection::MacroReflection</a>
  
    <li><a href="../../ActiveRecord/Relation.html">ActiveRecord::Relation</a>
  
    <li><a href="../../ActiveRecord/Result.html">ActiveRecord::Result</a>
  
    <li><a href="../../ActiveRecord/Rollback.html">ActiveRecord::Rollback</a>
  
    <li><a href="../../ActiveRecord/Sanitization.html">ActiveRecord::Sanitization</a>
  
    <li><a href="../../ActiveRecord/Sanitization/ClassMethods.html">ActiveRecord::Sanitization::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Schema.html">ActiveRecord::Schema</a>
  
    <li><a href="../../ActiveRecord/Scoping.html">ActiveRecord::Scoping</a>
  
    <li><a href="../../ActiveRecord/Scoping/ClassMethods.html">ActiveRecord::Scoping::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Scoping/Default.html">ActiveRecord::Scoping::Default</a>
  
    <li><a href="../../ActiveRecord/Scoping/Default/ClassMethods.html">ActiveRecord::Scoping::Default::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Scoping/Named.html">ActiveRecord::Scoping::Named</a>
  
    <li><a href="../../ActiveRecord/Scoping/Named/ClassMethods.html">ActiveRecord::Scoping::Named::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Serialization.html">ActiveRecord::Serialization</a>
  
    <li><a href="../../ActiveRecord/SerializationTypeMismatch.html">ActiveRecord::SerializationTypeMismatch</a>
  
    <li><a href="../../ActiveRecord/SessionStore.html">ActiveRecord::SessionStore</a>
  
    <li><a href="../../ActiveRecord/SessionStore/Session.html">ActiveRecord::SessionStore::Session</a>
  
    <li><a href="../../ActiveRecord/SessionStore/SqlBypass.html">ActiveRecord::SessionStore::SqlBypass</a>
  
    <li><a href="../../ActiveRecord/SpawnMethods.html">ActiveRecord::SpawnMethods</a>
  
    <li><a href="../../ActiveRecord/StaleObjectError.html">ActiveRecord::StaleObjectError</a>
  
    <li><a href="../../ActiveRecord/StatementInvalid.html">ActiveRecord::StatementInvalid</a>
  
    <li><a href="../../ActiveRecord/Store.html">ActiveRecord::Store</a>
  
    <li><a href="../../ActiveRecord/Store/ClassMethods.html">ActiveRecord::Store::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/TestFixtures.html">ActiveRecord::TestFixtures</a>
  
    <li><a href="../../ActiveRecord/TestFixtures/ClassMethods.html">ActiveRecord::TestFixtures::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/ThrowResult.html">ActiveRecord::ThrowResult</a>
  
    <li><a href="../../ActiveRecord/Timestamp.html">ActiveRecord::Timestamp</a>
  
    <li><a href="../../ActiveRecord/Transactions.html">ActiveRecord::Transactions</a>
  
    <li><a href="../../ActiveRecord/Transactions/ClassMethods.html">ActiveRecord::Transactions::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Translation.html">ActiveRecord::Translation</a>
  
    <li><a href="../../ActiveRecord/UnknownAttributeError.html">ActiveRecord::UnknownAttributeError</a>
  
    <li><a href="../../ActiveRecord/UnknownPrimaryKey.html">ActiveRecord::UnknownPrimaryKey</a>
  
    <li><a href="../../ActiveRecord/Validations.html">ActiveRecord::Validations</a>
  
    <li><a href="../../ActiveRecord/Validations/AssociatedValidator.html">ActiveRecord::Validations::AssociatedValidator</a>
  
    <li><a href="../../ActiveRecord/Validations/ClassMethods.html">ActiveRecord::Validations::ClassMethods</a>
  
    <li><a href="../../ActiveRecord/Validations/UniquenessValidator.html">ActiveRecord::Validations::UniquenessValidator</a>
  
    <li><a href="../../ActiveRecord/WrappedDatabaseException.html">ActiveRecord::WrappedDatabaseException</a>
  
    <li><a href="../../ActiveSupport.html">ActiveSupport</a>
  
    <li><a href="../../ActiveSupport/Autoload.html">ActiveSupport::Autoload</a>
  
    <li><a href="../../ActiveSupport/BacktraceCleaner.html">ActiveSupport::BacktraceCleaner</a>
  
    <li><a href="../../ActiveSupport/Base64.html">ActiveSupport::Base64</a>
  
    <li><a href="../../ActiveSupport/BasicObject.html">ActiveSupport::BasicObject</a>
  
    <li><a href="../../ActiveSupport/Benchmarkable.html">ActiveSupport::Benchmarkable</a>
  
    <li><a href="../../ActiveSupport/BufferedLogger.html">ActiveSupport::BufferedLogger</a>
  
    <li><a href="../../ActiveSupport/BufferedLogger/Severity.html">ActiveSupport::BufferedLogger::Severity</a>
  
    <li><a href="../../ActiveSupport/Cache.html">ActiveSupport::Cache</a>
  
    <li><a href="../../ActiveSupport/Cache/Entry.html">ActiveSupport::Cache::Entry</a>
  
    <li><a href="../../ActiveSupport/Cache/FileStore.html">ActiveSupport::Cache::FileStore</a>
  
    <li><a href="../../ActiveSupport/Cache/MemCacheStore.html">ActiveSupport::Cache::MemCacheStore</a>
  
    <li><a href="../../ActiveSupport/Cache/MemoryStore.html">ActiveSupport::Cache::MemoryStore</a>
  
    <li><a href="../../ActiveSupport/Cache/NullStore.html">ActiveSupport::Cache::NullStore</a>
  
    <li><a href="../../ActiveSupport/Cache/Store.html">ActiveSupport::Cache::Store</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy.html">ActiveSupport::Cache::Strategy</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy/LocalCache.html">ActiveSupport::Cache::Strategy::LocalCache</a>
  
    <li><a href="../../ActiveSupport/Cache/Strategy/LocalCache/LocalStore.html">ActiveSupport::Cache::Strategy::LocalCache::LocalStore</a>
  
    <li><a href="../../ActiveSupport/Callbacks.html">ActiveSupport::Callbacks</a>
  
    <li><a href="../../ActiveSupport/Callbacks/ClassMethods.html">ActiveSupport::Callbacks::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Concern.html">ActiveSupport::Concern</a>
  
    <li><a href="../../ActiveSupport/Configurable.html">ActiveSupport::Configurable</a>
  
    <li><a href="../../ActiveSupport/Configurable/ClassMethods.html">ActiveSupport::Configurable::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Configurable/Configuration.html">ActiveSupport::Configurable::Configuration</a>
  
    <li><a href="../../ActiveSupport/Dependencies.html">ActiveSupport::Dependencies</a>
  
    <li><a href="../../ActiveSupport/Dependencies/ClassCache.html">ActiveSupport::Dependencies::ClassCache</a>
  
    <li><a href="../../ActiveSupport/Dependencies/WatchStack.html">ActiveSupport::Dependencies::WatchStack</a>
  
    <li><a href="../../ActiveSupport/Deprecation.html">ActiveSupport::Deprecation</a>
  
    <li><a href="../../ActiveSupport/DescendantsTracker.html">ActiveSupport::DescendantsTracker</a>
  
    <li><a href="../../ActiveSupport/Duration.html">ActiveSupport::Duration</a>
  
    <li><a href="../../ActiveSupport/FileUpdateChecker.html">ActiveSupport::FileUpdateChecker</a>
  
    <li><a href="../../ActiveSupport/FileWatcher.html">ActiveSupport::FileWatcher</a>
  
    <li><a href="../../ActiveSupport/FileWatcher/Backend.html">ActiveSupport::FileWatcher::Backend</a>
  
    <li><a href="../../ActiveSupport/Gzip.html">ActiveSupport::Gzip</a>
  
    <li><a href="../../ActiveSupport/Gzip/Stream.html">ActiveSupport::Gzip::Stream</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">ActiveSupport::HashWithIndifferentAccess</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">ActiveSupport::HashWithIndifferentAccess</a>
  
    <li><a href="../../ActiveSupport/Inflector.html">ActiveSupport::Inflector</a>
  
    <li><a href="../../ActiveSupport/Inflector/Inflections.html">ActiveSupport::Inflector::Inflections</a>
  
    <li><a href="../../ActiveSupport/InheritableOptions.html">ActiveSupport::InheritableOptions</a>
  
    <li><a href="../../ActiveSupport/JSON.html">ActiveSupport::JSON</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding.html">ActiveSupport::JSON::Encoding</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding/CircularReferenceError.html">ActiveSupport::JSON::Encoding::CircularReferenceError</a>
  
    <li><a href="../../ActiveSupport/JSON/Encoding/Encoder.html">ActiveSupport::JSON::Encoding::Encoder</a>
  
    <li><a href="../../ActiveSupport/JSON/Variable.html">ActiveSupport::JSON::Variable</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber.html">ActiveSupport::LogSubscriber</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber/TestHelper.html">ActiveSupport::LogSubscriber::TestHelper</a>
  
    <li><a href="../../ActiveSupport/LogSubscriber/TestHelper/MockLogger.html">ActiveSupport::LogSubscriber::TestHelper::MockLogger</a>
  
    <li><a href="../../ActiveSupport/Memoizable.html">ActiveSupport::Memoizable</a>
  
    <li><a href="../../ActiveSupport/Memoizable/InstanceMethods.html">ActiveSupport::Memoizable::InstanceMethods</a>
  
    <li><a href="../../ActiveSupport/MessageEncryptor.html">ActiveSupport::MessageEncryptor</a>
  
    <li><a href="../../ActiveSupport/MessageEncryptor/InvalidMessage.html">ActiveSupport::MessageEncryptor::InvalidMessage</a>
  
    <li><a href="../../ActiveSupport/MessageVerifier.html">ActiveSupport::MessageVerifier</a>
  
    <li><a href="../../ActiveSupport/MessageVerifier/InvalidSignature.html">ActiveSupport::MessageVerifier::InvalidSignature</a>
  
    <li><a href="../../ActiveSupport/Multibyte.html">ActiveSupport::Multibyte</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Chars.html">ActiveSupport::Multibyte::Chars</a>
  
    <li><a href="../../ActiveSupport/Multibyte/EncodingError.html">ActiveSupport::Multibyte::EncodingError</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode.html">ActiveSupport::Multibyte::Unicode</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode/Codepoint.html">ActiveSupport::Multibyte::Unicode::Codepoint</a>
  
    <li><a href="../../ActiveSupport/Multibyte/Unicode/UnicodeDatabase.html">ActiveSupport::Multibyte::Unicode::UnicodeDatabase</a>
  
    <li><a href="../../ActiveSupport/Notifications.html">ActiveSupport::Notifications</a>
  
    <li><a href="../../ActiveSupport/Notifications/Event.html">ActiveSupport::Notifications::Event</a>
  
    <li><a href="../../ActiveSupport/Notifications/Fanout.html">ActiveSupport::Notifications::Fanout</a>
  
    <li><a href="../../ActiveSupport/Notifications/Instrumenter.html">ActiveSupport::Notifications::Instrumenter</a>
  
    <li><a href="../../ActiveSupport/OrderedHash.html">ActiveSupport::OrderedHash</a>
  
    <li><a href="../../ActiveSupport/OrderedOptions.html">ActiveSupport::OrderedOptions</a>
  
    <li><a href="../../ActiveSupport/Railtie.html">ActiveSupport::Railtie</a>
  
    <li><a href="../../ActiveSupport/Rescuable.html">ActiveSupport::Rescuable</a>
  
    <li><a href="../../ActiveSupport/Rescuable/ClassMethods.html">ActiveSupport::Rescuable::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/SafeBuffer.html">ActiveSupport::SafeBuffer</a>
  
    <li><a href="../../ActiveSupport/SafeBuffer/SafeConcatError.html">ActiveSupport::SafeBuffer::SafeConcatError</a>
  
    <li><a href="../../ActiveSupport/StringInquirer.html">ActiveSupport::StringInquirer</a>
  
    <li><a href="../../ActiveSupport/TaggedLogging.html">ActiveSupport::TaggedLogging</a>
  
    <li><a href="../../ActiveSupport/TestCase.html">ActiveSupport::TestCase</a>
  
    <li><a href="../../ActiveSupport/Testing.html">ActiveSupport::Testing</a>
  
    <li><a href="../../ActiveSupport/Testing/Assertions.html">ActiveSupport::Testing::Assertions</a>
  
    <li><a href="../../ActiveSupport/Testing/Declarative.html">ActiveSupport::Testing::Declarative</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation.html">ActiveSupport::Testing::Isolation</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/Forking.html">ActiveSupport::Testing::Isolation::Forking</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/MiniTest.html">ActiveSupport::Testing::Isolation::MiniTest</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/Subprocess.html">ActiveSupport::Testing::Isolation::Subprocess</a>
  
    <li><a href="../../ActiveSupport/Testing/Isolation/TestUnit.html">ActiveSupport::Testing::Isolation::TestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Pending.html">ActiveSupport::Testing::Pending</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance.html">ActiveSupport::Testing::Performance</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Benchmarker.html">ActiveSupport::Testing::Performance::Benchmarker</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/ForClassicTestUnit.html">ActiveSupport::Testing::Performance::ForClassicTestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/ForMiniTest.html">ActiveSupport::Testing::Performance::ForMiniTest</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics.html">ActiveSupport::Testing::Performance::Metrics</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Amount.html">ActiveSupport::Testing::Performance::Metrics::Amount</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Base.html">ActiveSupport::Testing::Performance::Metrics::Base</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/CpuTime.html">ActiveSupport::Testing::Performance::Metrics::CpuTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/DigitalInformationUnit.html">ActiveSupport::Testing::Performance::Metrics::DigitalInformationUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/GcRuns.html">ActiveSupport::Testing::Performance::Metrics::GcRuns</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/GcTime.html">ActiveSupport::Testing::Performance::Metrics::GcTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Memory.html">ActiveSupport::Testing::Performance::Metrics::Memory</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Objects.html">ActiveSupport::Testing::Performance::Metrics::Objects</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/ProcessTime.html">ActiveSupport::Testing::Performance::Metrics::ProcessTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/Time.html">ActiveSupport::Testing::Performance::Metrics::Time</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/UserTime.html">ActiveSupport::Testing::Performance::Metrics::UserTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Metrics/WallTime.html">ActiveSupport::Testing::Performance::Metrics::WallTime</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Performer.html">ActiveSupport::Testing::Performance::Performer</a>
  
    <li><a href="../../ActiveSupport/Testing/Performance/Profiler.html">ActiveSupport::Testing::Performance::Profiler</a>
  
    <li><a href="../../ActiveSupport/Testing/ProxyTestResult.html">ActiveSupport::Testing::ProxyTestResult</a>
  
    <li><a href="../../ActiveSupport/Testing/RemoteError.html">ActiveSupport::Testing::RemoteError</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown.html">ActiveSupport::Testing::SetupAndTeardown</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ClassMethods.html">ActiveSupport::Testing::SetupAndTeardown::ClassMethods</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ForClassicTestUnit.html">ActiveSupport::Testing::SetupAndTeardown::ForClassicTestUnit</a>
  
    <li><a href="../../ActiveSupport/Testing/SetupAndTeardown/ForMiniTest.html">ActiveSupport::Testing::SetupAndTeardown::ForMiniTest</a>
  
    <li><a href="../../ActiveSupport/TimeWithZone.html">ActiveSupport::TimeWithZone</a>
  
    <li><a href="../../ActiveSupport/TimeZone.html">ActiveSupport::TimeZone</a>
  
    <li><a href="../../ActiveSupport/XmlMini.html">ActiveSupport::XmlMini</a>
  
    <li><a href="../../ActiveSupport/XmlMini_LibXMLSAX.html">ActiveSupport::XmlMini_LibXMLSAX</a>
  
    <li><a href="../../ActiveSupport/XmlMini_LibXMLSAX/HashBuilder.html">ActiveSupport::XmlMini_LibXMLSAX::HashBuilder</a>
  
    <li><a href="../../ActiveSupport/XmlMini_NokogiriSAX.html">ActiveSupport::XmlMini_NokogiriSAX</a>
  
    <li><a href="../../ActiveSupport/XmlMini_NokogiriSAX/HashBuilder.html">ActiveSupport::XmlMini_NokogiriSAX::HashBuilder</a>
  
    <li><a href="../../ActionController.html">ActionController</a>
  
    <li><a href="../../ActionController/Base.html">ActionController::Base</a>
  
    <li><a href="../../ActionController/Caching.html">ActionController::Caching</a>
  
    <li><a href="../../ActionController/Caching/Actions.html">ActionController::Caching::Actions</a>
  
    <li><a href="../../ActionController/Caching/Actions/ActionCachePath.html">ActionController::Caching::Actions::ActionCachePath</a>
  
    <li><a href="../../ActionController/Caching/Actions/ClassMethods.html">ActionController::Caching::Actions::ClassMethods</a>
  
    <li><a href="../../ActionController/Caching/ConfigMethods.html">ActionController::Caching::ConfigMethods</a>
  
    <li><a href="../../ActionController/Caching/Fragments.html">ActionController::Caching::Fragments</a>
  
    <li><a href="../../ActionController/Caching/Pages.html">ActionController::Caching::Pages</a>
  
    <li><a href="../../ActionController/Caching/Pages/ClassMethods.html">ActionController::Caching::Pages::ClassMethods</a>
  
    <li><a href="../../ActionController/Caching/Sweeping.html">ActionController::Caching::Sweeping</a>
  
    <li><a href="../../ActionController/Compatibility.html">ActionController::Compatibility</a>
  
    <li><a href="../../ActionController/ConditionalGet.html">ActionController::ConditionalGet</a>
  
    <li><a href="../../ActionController/Cookies.html">ActionController::Cookies</a>
  
    <li><a href="../../ActionController/DataStreaming.html">ActionController::DataStreaming</a>
  
    <li><a href="../../ActionController/Flash.html">ActionController::Flash</a>
  
    <li><a href="../../ActionController/ForceSSL.html">ActionController::ForceSSL</a>
  
    <li><a href="../../ActionController/ForceSSL/ClassMethods.html">ActionController::ForceSSL::ClassMethods</a>
  
    <li><a href="../../ActionController/Head.html">ActionController::Head</a>
  
    <li><a href="../../ActionController/Helpers.html">ActionController::Helpers</a>
  
    <li><a href="../../ActionController/Helpers/ClassMethods.html">ActionController::Helpers::ClassMethods</a>
  
    <li><a href="../../ActionController/HideActions.html">ActionController::HideActions</a>
  
    <li><a href="../../ActionController/HideActions/ClassMethods.html">ActionController::HideActions::ClassMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication.html">ActionController::HttpAuthentication</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic.html">ActionController::HttpAuthentication::Basic</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic/ControllerMethods.html">ActionController::HttpAuthentication::Basic::ControllerMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Basic/ControllerMethods/ClassMethods.html">ActionController::HttpAuthentication::Basic::ControllerMethods::ClassMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Digest.html">ActionController::HttpAuthentication::Digest</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Digest/ControllerMethods.html">ActionController::HttpAuthentication::Digest::ControllerMethods</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Token.html">ActionController::HttpAuthentication::Token</a>
  
    <li><a href="../../ActionController/HttpAuthentication/Token/ControllerMethods.html">ActionController::HttpAuthentication::Token::ControllerMethods</a>
  
    <li><a href="../../ActionController/ImplicitRender.html">ActionController::ImplicitRender</a>
  
    <li><a href="../../ActionController/Instrumentation.html">ActionController::Instrumentation</a>
  
    <li><a href="../../ActionController/Instrumentation/ClassMethods.html">ActionController::Instrumentation::ClassMethods</a>
  
    <li><a href="../../ActionController/LogSubscriber.html">ActionController::LogSubscriber</a>
  
    <li><a href="../../ActionController/Metal.html">ActionController::Metal</a>
  
    <li><a href="../../ActionController/Middleware.html">ActionController::Middleware</a>
  
    <li><a href="../../ActionController/Middleware/ActionMiddleware.html">ActionController::Middleware::ActionMiddleware</a>
  
    <li><a href="../../ActionController/MimeResponds.html">ActionController::MimeResponds</a>
  
    <li><a href="../../ActionController/MimeResponds/ClassMethods.html">ActionController::MimeResponds::ClassMethods</a>
  
    <li><a href="../../ActionController/ParamsWrapper.html">ActionController::ParamsWrapper</a>
  
    <li><a href="../../ActionController/ParamsWrapper/ClassMethods.html">ActionController::ParamsWrapper::ClassMethods</a>
  
    <li><a href="../../ActionController/RackDelegation.html">ActionController::RackDelegation</a>
  
    <li><a href="../../ActionController/Railtie.html">ActionController::Railtie</a>
  
    <li><a href="../../ActionController/Railties.html">ActionController::Railties</a>
  
    <li><a href="../../ActionController/Railties/Paths.html">ActionController::Railties::Paths</a>
  
    <li><a href="../../ActionController/RecordIdentifier.html">ActionController::RecordIdentifier</a>
  
    <li><a href="../../ActionController/Redirecting.html">ActionController::Redirecting</a>
  
    <li><a href="../../ActionController/Renderers.html">ActionController::Renderers</a>
  
    <li><a href="../../ActionController/Renderers/All.html">ActionController::Renderers::All</a>
  
    <li><a href="../../ActionController/Renderers/ClassMethods.html">ActionController::Renderers::ClassMethods</a>
  
    <li><a href="../../ActionController/Rendering.html">ActionController::Rendering</a>
  
    <li><a href="../../ActionController/RequestForgeryProtection.html">ActionController::RequestForgeryProtection</a>
  
    <li><a href="../../ActionController/RequestForgeryProtection/ClassMethods.html">ActionController::RequestForgeryProtection::ClassMethods</a>
  
    <li><a href="../../ActionController/Rescue.html">ActionController::Rescue</a>
  
    <li><a href="../../ActionController/Responder.html">ActionController::Responder</a>
  
    <li><a href="../../ActionController/SessionManagement.html">ActionController::SessionManagement</a>
  
    <li><a href="../../ActionController/SessionManagement/ClassMethods.html">ActionController::SessionManagement::ClassMethods</a>
  
    <li><a href="../../ActionController/Streaming.html">ActionController::Streaming</a>
  
    <li><a href="../../ActionController/TemplateAssertions.html">ActionController::TemplateAssertions</a>
  
    <li><a href="../../ActionController/TestCase.html">ActionController::TestCase</a>
  
    <li><a href="../../ActionController/TestCase/Behavior.html">ActionController::TestCase::Behavior</a>
  
    <li><a href="../../ActionController/TestCase/Behavior/ClassMethods.html">ActionController::TestCase::Behavior::ClassMethods</a>
  
    <li><a href="../../ActionController/TestCase/RaiseActionExceptions.html">ActionController::TestCase::RaiseActionExceptions</a>
  
    <li><a href="../../ActionController/TestResponse.html">ActionController::TestResponse</a>
  
    <li><a href="../../ActionController/Testing.html">ActionController::Testing</a>
  
    <li><a href="../../ActionController/Testing/ClassMethods.html">ActionController::Testing::ClassMethods</a>
  
    <li><a href="../../ActionController/UrlFor.html">ActionController::UrlFor</a>
  
    <li><a href="../../ActionView.html">ActionView</a>
  
    <li><a href="../../ActionView/ActionView.html">ActionView::ActionView</a>
  
    <li><a href="../../ActionView/ActionView/ActionView.html">ActionView::ActionView::ActionView</a>
  
    <li><a href="../../ActionView/ActionView/ActionView/Base.html">ActionView::ActionView::ActionView::Base</a>
  
    <li><a href="../../ActionView/Base.html">ActionView::Base</a>
  
    <li><a href="../../ActionView/Context.html">ActionView::Context</a>
  
    <li><a href="../../ActionView/FileSystemResolver.html">ActionView::FileSystemResolver</a>
  
    <li><a href="../../ActionView/FixtureResolver.html">ActionView::FixtureResolver</a>
  
    <li><a href="../../ActionView/Helpers.html">ActionView::Helpers</a>
  
    <li><a href="../../ActionView/Helpers/ActiveModelHelper.html">ActionView::Helpers::ActiveModelHelper</a>
  
    <li><a href="../../ActionView/Helpers/ActiveModelInstanceTag.html">ActionView::Helpers::ActiveModelInstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper.html">ActionView::Helpers::AssetTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/AssetIncludeTag.html">ActionView::Helpers::AssetTagHelper::AssetIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptIncludeTag.html">ActionView::Helpers::AssetTagHelper::JavascriptIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptTagHelpers.html">ActionView::Helpers::AssetTagHelper::JavascriptTagHelpers</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/JavascriptTagHelpers/ClassMethods.html">ActionView::Helpers::AssetTagHelper::JavascriptTagHelpers::ClassMethods</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetIncludeTag.html">ActionView::Helpers::AssetTagHelper::StylesheetIncludeTag</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetTagHelpers.html">ActionView::Helpers::AssetTagHelper::StylesheetTagHelpers</a>
  
    <li><a href="../../ActionView/Helpers/AssetTagHelper/StylesheetTagHelpers/ClassMethods.html">ActionView::Helpers::AssetTagHelper::StylesheetTagHelpers::ClassMethods</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper.html">ActionView::Helpers::AtomFeedHelper</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper/AtomBuilder.html">ActionView::Helpers::AtomFeedHelper::AtomBuilder</a>
  
    <li><a href="../../ActionView/Helpers/AtomFeedHelper/AtomFeedBuilder.html">ActionView::Helpers::AtomFeedHelper::AtomFeedBuilder</a>
  
    <li><a href="../../ActionView/Helpers/CacheHelper.html">ActionView::Helpers::CacheHelper</a>
  
    <li><a href="../../ActionView/Helpers/CaptureHelper.html">ActionView::Helpers::CaptureHelper</a>
  
    <li><a href="../../ActionView/Helpers/CsrfHelper.html">ActionView::Helpers::CsrfHelper</a>
  
    <li><a href="../../ActionView/Helpers/DateHelper.html">ActionView::Helpers::DateHelper</a>
  
    <li><a href="../../ActionView/Helpers/DateHelperInstanceTag.html">ActionView::Helpers::DateHelperInstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/DebugHelper.html">ActionView::Helpers::DebugHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormBuilder.html">ActionView::Helpers::FormBuilder</a>
  
    <li><a href="../../ActionView/Helpers/FormHelper.html">ActionView::Helpers::FormHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormOptionsHelper.html">ActionView::Helpers::FormOptionsHelper</a>
  
    <li><a href="../../ActionView/Helpers/FormTagHelper.html">ActionView::Helpers::FormTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/InstanceTag.html">ActionView::Helpers::InstanceTag</a>
  
    <li><a href="../../ActionView/Helpers/JavaScriptHelper.html">ActionView::Helpers::JavaScriptHelper</a>
  
    <li><a href="../../ActionView/Helpers/NumberHelper.html">ActionView::Helpers::NumberHelper</a>
  
    <li><a href="../../ActionView/Helpers/NumberHelper/InvalidNumberError.html">ActionView::Helpers::NumberHelper::InvalidNumberError</a>
  
    <li><a href="../../ActionView/Helpers/OutputSafetyHelper.html">ActionView::Helpers::OutputSafetyHelper</a>
  
    <li><a href="../../ActionView/Helpers/RecordTagHelper.html">ActionView::Helpers::RecordTagHelper</a>
  
    <li><a href="../../ActionView/Helpers/RenderingHelper.html">ActionView::Helpers::RenderingHelper</a>
  
    <li><a href="../../ActionView/Helpers/SanitizeHelper.html">ActionView::Helpers::SanitizeHelper</a>
  
    <li><a href="../../ActionView/Helpers/TagHelper.html">ActionView::Helpers::TagHelper</a>
  
    <li><a href="../../ActionView/Helpers/TextHelper.html">ActionView::Helpers::TextHelper</a>
  
    <li><a href="../../ActionView/Helpers/TranslationHelper.html">ActionView::Helpers::TranslationHelper</a>
  
    <li><a href="../../ActionView/Helpers/UrlHelper.html">ActionView::Helpers::UrlHelper</a>
  
    <li><a href="../../ActionView/LogSubscriber.html">ActionView::LogSubscriber</a>
  
    <li><a href="../../ActionView/LookupContext.html">ActionView::LookupContext</a>
  
    <li><a href="../../ActionView/LookupContext/DetailsCache.html">ActionView::LookupContext::DetailsCache</a>
  
    <li><a href="../../ActionView/LookupContext/ViewPaths.html">ActionView::LookupContext::ViewPaths</a>
  
    <li><a href="../../ActionView/NullResolver.html">ActionView::NullResolver</a>
  
    <li><a href="../../ActionView/PartialRenderer.html">ActionView::PartialRenderer</a>
  
    <li><a href="../../ActionView/Railtie.html">ActionView::Railtie</a>
  
    <li><a href="../../ActionView/Renderer.html">ActionView::Renderer</a>
  
    <li><a href="../../ActionView/Resolver.html">ActionView::Resolver</a>
  
    <li><a href="../../ActionView/Resolver/Path.html">ActionView::Resolver::Path</a>
  
    <li><a href="../../ActionView/Template.html">ActionView::Template</a>
  
    <li><a href="../../ActionView/Template/Handlers.html">ActionView::Template::Handlers</a>
  
    <li><a href="../../ActionView/Template/Handlers/Builder.html">ActionView::Template::Handlers::Builder</a>
  
    <li><a href="../../ActionView/Template/Handlers/ERB.html">ActionView::Template::Handlers::ERB</a>
  
    <li><a href="../../ActionView/Template/Handlers/Erubis.html">ActionView::Template::Handlers::Erubis</a>
  
    <li><a href="../../ActionView/TestCase.html">ActionView::TestCase</a>
  
    <li><a href="../../ActionView/TestCase/Behavior.html">ActionView::TestCase::Behavior</a>
  
    <li><a href="../../ActionView/TestCase/Behavior/ClassMethods.html">ActionView::TestCase::Behavior::ClassMethods</a>
  
    <li><a href="../../ActionView/TestCase/Behavior/Locals.html">ActionView::TestCase::Behavior::Locals</a>
  
    <li><a href="../../ActionView/TestCase/TestController.html">ActionView::TestCase::TestController</a>
  
    <li><a href="../../ActiveModel.html">ActiveModel</a>
  
    <li><a href="../../ActiveModel/AttributeMethods.html">ActiveModel::AttributeMethods</a>
  
    <li><a href="../../ActiveModel/AttributeMethods/ClassMethods.html">ActiveModel::AttributeMethods::ClassMethods</a>
  
    <li><a href="../../ActiveModel/AttributeMethods/ClassMethods/AttributeMethodMatcher.html">ActiveModel::AttributeMethods::ClassMethods::AttributeMethodMatcher</a>
  
    <li><a href="../../ActiveModel/BlockValidator.html">ActiveModel::BlockValidator</a>
  
    <li><a href="../../ActiveModel/Callbacks.html">ActiveModel::Callbacks</a>
  
    <li><a href="../../ActiveModel/Conversion.html">ActiveModel::Conversion</a>
  
    <li><a href="../../ActiveModel/Dirty.html">ActiveModel::Dirty</a>
  
    <li><a href="../../ActiveModel/EachValidator.html">ActiveModel::EachValidator</a>
  
    <li><a href="../../ActiveModel/Errors.html">ActiveModel::Errors</a>
  
    <li><a href="../../ActiveModel/Lint.html">ActiveModel::Lint</a>
  
    <li><a href="../../ActiveModel/Lint/Tests.html">ActiveModel::Lint::Tests</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity.html">ActiveModel::MassAssignmentSecurity</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/BlackList.html">ActiveModel::MassAssignmentSecurity::BlackList</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/ClassMethods.html">ActiveModel::MassAssignmentSecurity::ClassMethods</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/Error.html">ActiveModel::MassAssignmentSecurity::Error</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/LoggerSanitizer.html">ActiveModel::MassAssignmentSecurity::LoggerSanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/PermissionSet.html">ActiveModel::MassAssignmentSecurity::PermissionSet</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/Sanitizer.html">ActiveModel::MassAssignmentSecurity::Sanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/StrictSanitizer.html">ActiveModel::MassAssignmentSecurity::StrictSanitizer</a>
  
    <li><a href="../../ActiveModel/MassAssignmentSecurity/WhiteList.html">ActiveModel::MassAssignmentSecurity::WhiteList</a>
  
    <li><a href="../../ActiveModel/MissingAttributeError.html">ActiveModel::MissingAttributeError</a>
  
    <li><a href="../../ActiveModel/Name.html">ActiveModel::Name</a>
  
    <li><a href="../../ActiveModel/Naming.html">ActiveModel::Naming</a>
  
    <li><a href="../../ActiveModel/Observer.html">ActiveModel::Observer</a>
  
    <li><a href="../../ActiveModel/ObserverArray.html">ActiveModel::ObserverArray</a>
  
    <li><a href="../../ActiveModel/Observing.html">ActiveModel::Observing</a>
  
    <li><a href="../../ActiveModel/Observing/ClassMethods.html">ActiveModel::Observing::ClassMethods</a>
  
    <li><a href="../../ActiveModel/SecurePassword.html">ActiveModel::SecurePassword</a>
  
    <li><a href="../../ActiveModel/SecurePassword/ClassMethods.html">ActiveModel::SecurePassword::ClassMethods</a>
  
    <li><a href="../../ActiveModel/SecurePassword/InstanceMethodsOnActivation.html">ActiveModel::SecurePassword::InstanceMethodsOnActivation</a>
  
    <li><a href="../../ActiveModel/Serialization.html">ActiveModel::Serialization</a>
  
    <li><a href="../../ActiveModel/Serializers.html">ActiveModel::Serializers</a>
  
    <li><a href="../../ActiveModel/Serializers/JSON.html">ActiveModel::Serializers::JSON</a>
  
    <li><a href="../../ActiveModel/Serializers/Xml.html">ActiveModel::Serializers::Xml</a>
  
    <li><a href="../../ActiveModel/StrictValidationFailed.html">ActiveModel::StrictValidationFailed</a>
  
    <li><a href="../../ActiveModel/Translation.html">ActiveModel::Translation</a>
  
    <li><a href="../../ActiveModel/Validations.html">ActiveModel::Validations</a>
  
    <li><a href="../../ActiveModel/Validations/AcceptanceValidator.html">ActiveModel::Validations::AcceptanceValidator</a>
  
    <li><a href="../../ActiveModel/Validations/Callbacks.html">ActiveModel::Validations::Callbacks</a>
  
    <li><a href="../../ActiveModel/Validations/Callbacks/ClassMethods.html">ActiveModel::Validations::Callbacks::ClassMethods</a>
  
    <li><a href="../../ActiveModel/Validations/ClassMethods.html">ActiveModel::Validations::ClassMethods</a>
  
    <li><a href="../../ActiveModel/Validations/ConfirmationValidator.html">ActiveModel::Validations::ConfirmationValidator</a>
  
    <li><a href="../../ActiveModel/Validations/ExclusionValidator.html">ActiveModel::Validations::ExclusionValidator</a>
  
    <li><a href="../../ActiveModel/Validations/FormatValidator.html">ActiveModel::Validations::FormatValidator</a>
  
    <li><a href="../../ActiveModel/Validations/HelperMethods.html">ActiveModel::Validations::HelperMethods</a>
  
    <li><a href="../../ActiveModel/Validations/InclusionValidator.html">ActiveModel::Validations::InclusionValidator</a>
  
    <li><a href="../../ActiveModel/Validations/LengthValidator.html">ActiveModel::Validations::LengthValidator</a>
  
    <li><a href="../../ActiveModel/Validations/NumericalityValidator.html">ActiveModel::Validations::NumericalityValidator</a>
  
    <li><a href="../../ActiveModel/Validations/PresenceValidator.html">ActiveModel::Validations::PresenceValidator</a>
  
    <li><a href="../../ActiveModel/Validations/WithValidator.html">ActiveModel::Validations::WithValidator</a>
  
    <li><a href="../../ActiveModel/Validator.html">ActiveModel::Validator</a>
  
    <li><a href="../../ActiveResource.html">ActiveResource</a>
  
    <li><a href="../../ActiveResource/Base.html">ActiveResource::Base</a>
  
    <li><a href="../../ActiveResource/Connection.html">ActiveResource::Connection</a>
  
    <li><a href="../../ActiveResource/CustomMethods.html">ActiveResource::CustomMethods</a>
  
    <li><a href="../../ActiveResource/CustomMethods/ClassMethods.html">ActiveResource::CustomMethods::ClassMethods</a>
  
    <li><a href="../../ActiveResource/Errors.html">ActiveResource::Errors</a>
  
    <li><a href="../../ActiveResource/Formats.html">ActiveResource::Formats</a>
  
    <li><a href="../../ActiveResource/Formats/JsonFormat.html">ActiveResource::Formats::JsonFormat</a>
  
    <li><a href="../../ActiveResource/Formats/XmlFormat.html">ActiveResource::Formats::XmlFormat</a>
  
    <li><a href="../../ActiveResource/HttpMock.html">ActiveResource::HttpMock</a>
  
    <li><a href="../../ActiveResource/InvalidRequestError.html">ActiveResource::InvalidRequestError</a>
  
    <li><a href="../../ActiveResource/LogSubscriber.html">ActiveResource::LogSubscriber</a>
  
    <li><a href="../../ActiveResource/Observing.html">ActiveResource::Observing</a>
  
    <li><a href="../../ActiveResource/Railtie.html">ActiveResource::Railtie</a>
  
    <li><a href="../../ActiveResource/Request.html">ActiveResource::Request</a>
  
    <li><a href="../../ActiveResource/Response.html">ActiveResource::Response</a>
  
    <li><a href="../../ActiveResource/SSLError.html">ActiveResource::SSLError</a>
  
    <li><a href="../../ActiveResource/TimeoutError.html">ActiveResource::TimeoutError</a>
  
    <li><a href="../../ActiveResource/Validations.html">ActiveResource::Validations</a>
  
    <li><a href="../../HTML.html">HTML</a>
  
    <li><a href="../../HTML/FullSanitizer.html">HTML::FullSanitizer</a>
  
    <li><a href="../../HTML/LinkSanitizer.html">HTML::LinkSanitizer</a>
  
    <li><a href="../../HTML/Sanitizer.html">HTML::Sanitizer</a>
  
    <li><a href="../../HTML/Selector.html">HTML::Selector</a>
  
    <li><a href="../../HTML/Tag.html">HTML::Tag</a>
  
    <li><a href="../../HTML/WhiteListSanitizer.html">HTML::WhiteListSanitizer</a>
  
    <li><a href="../../Mysql.html">Mysql</a>
  
    <li><a href="../../Mysql/Result.html">Mysql::Result</a>
  
    <li><a href="../../Mysql/Stmt.html">Mysql::Stmt</a>
  
    <li><a href="../../Mysql/Time.html">Mysql::Time</a>
  
    <li><a href="../../Test.html">Test</a>
  
    <li><a href="../../Test/Unit.html">Test::Unit</a>
  
    <li><a href="../../Test/Unit/Collector.html">Test::Unit::Collector</a>
  
    <li><a href="../../Test/Unit/Collector/ObjectSpace.html">Test::Unit::Collector::ObjectSpace</a>
  
    <li><a href="../../I18n.html">I18n</a>
  
    <li><a href="../../I18n/ExceptionHandler.html">I18n::ExceptionHandler</a>
  
    <li><a href="../../I18n/Railtie.html">I18n::Railtie</a>
  
    <li><a href="../../Object.html">Object</a>
  
    <li><a href="../../ActiveSupport/HashWithIndifferentAccess.html">Object::HashWithIndifferentAccess</a>
  
    <li><a href="../../LoadError.html">Object::MissingSourceFile</a>
  
    <li><a href="../../ActionMailer.html">ActionMailer</a>
  
    <li><a href="../../ActionMailer/Base.html">ActionMailer::Base</a>
  
    <li><a href="../../ArJdbcMySQL.html">ArJdbcMySQL</a>
  
    <li><a href="../../ArJdbcMySQL/Error.html">ArJdbcMySQL::Error</a>
  
    <li><a href="../../ERB.html">ERB</a>
  
    <li><a href="../../ERB/Util.html">ERB::Util</a>
  
    <li><a href="../../LoadError.html">LoadError</a>
  
    <li><a href="../../LoadError.html">LoadError</a>
  
    <li><a href="../../Logger.html">Logger</a>
  
    <li><a href="../../Logger/SimpleFormatter.html">Logger::SimpleFormatter</a>
  
    <li><a href="../../Array.html">Array</a>
  
    <li><a href="../../Base64.html">Base64</a>
  
    <li><a href="../../Benchmark.html">Benchmark</a>
  
    <li><a href="../../BigDecimal.html">BigDecimal</a>
  
    <li><a href="../../Class.html">Class</a>
  
    <li><a href="../../Date.html">Date</a>
  
    <li><a href="../../DateTime.html">DateTime</a>
  
    <li><a href="../../Enumerable.html">Enumerable</a>
  
    <li><a href="../../FalseClass.html">FalseClass</a>
  
    <li><a href="../../File.html">File</a>
  
    <li><a href="../../Float.html">Float</a>
  
    <li><a href="../../Hash.html">Hash</a>
  
    <li><a href="../../Integer.html">Integer</a>
  
    <li><a href="../../Kernel.html">Kernel</a>
  
    <li><a href="../../Module.html">Module</a>
  
    <li><a href="../../NameError.html">NameError</a>
  
    <li><a href="../../NilClass.html">NilClass</a>
  
    <li><a href="../../Numeric.html">Numeric</a>
  
    <li><a href="../../Process.html">Process</a>
  
    <li><a href="../../QualifiedConstUtils.html">QualifiedConstUtils</a>
  
    <li><a href="../../Rails.html">Rails</a>
  
    <li><a href="../../Range.html">Range</a>
  
    <li><a href="../../Regexp.html">Regexp</a>
  
    <li><a href="../../String.html">String</a>
  
    <li><a href="../../Symbol.html">Symbol</a>
  
    <li><a href="../../Time.html">Time</a>
  
    <li><a href="../../TrueClass.html">TrueClass</a>
  
    <li><a href="../../URI.html">URI</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class ActiveRecord::ConnectionAdapters::PostgreSQLAdapter</h1>

  <div id="description" class="description">
    
<p>The PostgreSQL adapter works both with the native C (<a
href="http://ruby.scripting.ca/postgres/">ruby.scripting.ca/postgres/</a>)
and the pure Ruby (available both as gem and from <a
href="http://rubyforge.org/frs/?group_id=234&release_id=1944">rubyforge.org/frs/?group_id=234&release_id=1944</a>)
drivers.</p>

<p>Options:</p>
<ul><li>
<p><code>:host</code> - Defaults to "localhost".</p>
</li><li>
<p><code>:port</code> - Defaults to 5432.</p>
</li><li>
<p><code>:username</code> - Defaults to nothing.</p>
</li><li>
<p><code>:password</code> - Defaults to nothing.</p>
</li><li>
<p><code>:database</code> - The name of the database. No default, must be
provided.</p>
</li><li>
<p><code>:schema_search_path</code> - An optional schema search path for the
connection given as a string of comma-separated schema names. This is
backward-compatible with the <code>:schema_order</code> option.</p>
</li><li>
<p><code>:encoding</code> - An optional client encoding that is used in a
<code>SET client_encoding TO &lt;encoding&gt;</code> call on the
connection.</p>
</li><li>
<p><code>:min_messages</code> - An optional client min messages that is used
in a <code>SET client_min_messages TO &lt;min_messages&gt;</code> call on
the connection.</p>
</li></ul>

  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    
    <!-- Constants -->
    <section id="constants-list" class="section">
      <h3 class="section-header">Constants</h3>
      <dl>
      
        <dt id="ADAPTER_NAME">ADAPTER_NAME
        
        <dd class="description">
        
      
        <dt id="NATIVE_DATABASE_TYPES">NATIVE_DATABASE_TYPES
        
        <dd class="description">
        
      
      </dl>
    </section>
    

    

    <!-- Methods -->
    
     <section id="public-class-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Class Methods</h3>

    
      <div id="method-c-new" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">(connection, logger, connection_parameters, config)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Initializes and connects a PostgreSQL adapter.</p>
          

          
          <div class="method-source-code" id="new-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 312</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">logger</span>, <span class="ruby-identifier">connection_parameters</span>, <span class="ruby-identifier">config</span>)
  <span class="ruby-keyword">super</span>(<span class="ruby-identifier">connection</span>, <span class="ruby-identifier">logger</span>)

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:prepared_statements</span>) { <span class="ruby-keyword">true</span> }
    <span class="ruby-ivar">@visitor</span> = <span class="ruby-constant">Arel</span><span class="ruby-operator">::</span><span class="ruby-constant">Visitors</span><span class="ruby-operator">::</span><span class="ruby-constant">PostgreSQL</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@visitor</span> = <span class="ruby-constant">BindSubstitution</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword">self</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">connection_parameters</span>.<span class="ruby-identifier">delete</span> <span class="ruby-value">:prepared_statements</span>

  <span class="ruby-ivar">@connection_parameters</span>, <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">connection_parameters</span>, <span class="ruby-identifier">config</span>

  <span class="ruby-comment"># @local_tz is initialized as nil to avoid warnings when connect tries to use it</span>
  <span class="ruby-ivar">@local_tz</span> = <span class="ruby-keyword">nil</span>
  <span class="ruby-ivar">@table_alias_length</span> = <span class="ruby-keyword">nil</span>

  <span class="ruby-identifier">connect</span>
  <span class="ruby-ivar">@statements</span> = <span class="ruby-constant">StatementPool</span>.<span class="ruby-identifier">new</span> <span class="ruby-ivar">@connection</span>,
                                  <span class="ruby-identifier">config</span>.<span class="ruby-identifier">fetch</span>(<span class="ruby-value">:statement_limit</span>) { <span class="ruby-value">1000</span> }

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">postgresql_version</span> <span class="ruby-operator">&lt;</span> <span class="ruby-value">80200</span>
    <span class="ruby-identifier">raise</span> <span class="ruby-node">&quot;Your version of PostgreSQL (#{postgresql_version}) is too old, please upgrade!&quot;</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-ivar">@local_tz</span> = <span class="ruby-identifier">execute</span>(<span class="ruby-string">'SHOW TIME ZONE'</span>, <span class="ruby-string">'SCHEMA'</span>).<span class="ruby-identifier">first</span>[<span class="ruby-string">&quot;TimeZone&quot;</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- new-source -->
          
        </div>

        

        
      </div><!-- new-method -->

    
    </section><!-- public-class-method-details -->
  
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-active-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">active?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Is this connection alive and ready for queries?</p>
          

          
          <div class="method-source-code" id="active-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 346</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">active?</span>
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">query</span> <span class="ruby-string">'SELECT 1'</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">rescue</span> <span class="ruby-constant">PGError</span>
  <span class="ruby-keyword">false</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- active-3F-source -->
          
        </div>

        

        
      </div><!-- active-3F-method -->

    
      <div id="method-i-adapter_name" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">adapter_name</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns ‘PostgreSQL’ as adapter name for identification purposes.</p>
          

          
          <div class="method-source-code" id="adapter_name-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 241</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">adapter_name</span>
  <span class="ruby-constant">ADAPTER_NAME</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- adapter_name-source -->
          
        </div>

        

        
      </div><!-- adapter_name-method -->

    
      <div id="method-i-add_column" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">add_column</span><span
            class="method-args">(table_name, column_name, type, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Adds a new column to the named table. See <a
href="TableDefinition.html#method-i-column">ActiveRecord::ConnectionAdapters::TableDefinition#column</a>
for details of the options you can use.</p>
          

          
          <div class="method-source-code" id="add_column-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1025</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">add_column</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">add_column_sql</span> = <span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(table_name)} ADD COLUMN #{quote_column_name(column_name)} #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}&quot;</span>
  <span class="ruby-identifier">add_column_options!</span>(<span class="ruby-identifier">add_column_sql</span>, <span class="ruby-identifier">options</span>)

  <span class="ruby-identifier">execute</span> <span class="ruby-identifier">add_column_sql</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- add_column-source -->
          
        </div>

        

        
      </div><!-- add_column-method -->

    
      <div id="method-i-begin_db_transaction" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">begin_db_transaction</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Begins a transaction.</p>
          

          
          <div class="method-source-code" id="begin_db_transaction-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 702</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">begin_db_transaction</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-string">&quot;BEGIN&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- begin_db_transaction-source -->
          
        </div>

        

        
      </div><!-- begin_db_transaction-method -->

    
      <div id="method-i-change_column" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">change_column</span><span
            class="method-args">(table_name, column_name, type, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Changes the column of a table.</p>
          

          
          <div class="method-source-code" id="change_column-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1034</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">quoted_table_name</span> = <span class="ruby-identifier">quote_table_name</span>(<span class="ruby-identifier">table_name</span>)

  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER TABLE #{quoted_table_name} ALTER COLUMN #{quote_column_name(column_name)} TYPE #{type_to_sql(type, options[:limit], options[:precision], options[:scale])}&quot;</span>

  <span class="ruby-identifier">change_column_default</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:default</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">options_include_default?</span>(<span class="ruby-identifier">options</span>)
  <span class="ruby-identifier">change_column_null</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">options</span>[<span class="ruby-value">:null</span>], <span class="ruby-identifier">options</span>[<span class="ruby-value">:default</span>]) <span class="ruby-keyword">if</span> <span class="ruby-identifier">options</span>.<span class="ruby-identifier">key?</span>(<span class="ruby-value">:null</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- change_column-source -->
          
        </div>

        

        
      </div><!-- change_column-method -->

    
      <div id="method-i-change_column_default" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">change_column_default</span><span
            class="method-args">(table_name, column_name, default)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Changes the default value of a table column.</p>
          

          
          <div class="method-source-code" id="change_column_default-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1045</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_default</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">default</span>)
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(table_name)} ALTER COLUMN #{quote_column_name(column_name)} SET DEFAULT #{quote(default)}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- change_column_default-source -->
          
        </div>

        

        
      </div><!-- change_column_default-method -->

    
      <div id="method-i-change_column_null" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">change_column_null</span><span
            class="method-args">(table_name, column_name, null, default = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="change_column_null-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1050</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">change_column_null</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">null</span>, <span class="ruby-identifier">default</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">null</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">default</span>.<span class="ruby-identifier">nil?</span>
    <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;UPDATE #{quote_table_name(table_name)} SET #{quote_column_name(column_name)}=#{quote(default)} WHERE #{quote_column_name(column_name)} IS NULL&quot;</span>)
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(table_name)} ALTER #{quote_column_name(column_name)} #{null ? 'DROP' : 'SET'} NOT NULL&quot;</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- change_column_null-source -->
          
        </div>

        

        
      </div><!-- change_column_null-method -->

    
      <div id="method-i-clear_cache-21" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">clear_cache!</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Clears the prepared statements cache.</p>
          

          
          <div class="method-source-code" id="clear_cache-21-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 341</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-ivar">@statements</span>.<span class="ruby-identifier">clear</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- clear_cache-21-source -->
          
        </div>

        

        
      </div><!-- clear_cache-21-method -->

    
      <div id="method-i-client_min_messages" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">client_min_messages</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the current client message level.</p>
          

          
          <div class="method-source-code" id="client_min_messages-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 900</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">client_min_messages</span>
  <span class="ruby-identifier">query</span>(<span class="ruby-string">'SHOW client_min_messages'</span>, <span class="ruby-string">'SCHEMA'</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- client_min_messages-source -->
          
        </div>

        

        
      </div><!-- client_min_messages-method -->

    
      <div id="method-i-client_min_messages-3D" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">client_min_messages=</span><span
            class="method-args">(level)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Set the client message level.</p>
          

          
          <div class="method-source-code" id="client_min_messages-3D-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 905</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">client_min_messages=</span>(<span class="ruby-identifier">level</span>)
  <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;SET client_min_messages TO '#{level}'&quot;</span>, <span class="ruby-string">'SCHEMA'</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- client_min_messages-3D-source -->
          
        </div>

        

        
      </div><!-- client_min_messages-3D-method -->

    
      <div id="method-i-columns" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">columns</span><span
            class="method-args">(table_name, name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the list of all column definitions for a table.</p>
          

          
          <div class="method-source-code" id="columns-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 857</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">columns</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-comment"># Limit, precision, and scale are all handled by the superclass.</span>
  <span class="ruby-identifier">column_definitions</span>(<span class="ruby-identifier">table_name</span>).<span class="ruby-identifier">collect</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">notnull</span><span class="ruby-operator">|</span>
    <span class="ruby-constant">PostgreSQLColumn</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">default</span>, <span class="ruby-identifier">type</span>, <span class="ruby-identifier">notnull</span> <span class="ruby-operator">==</span> <span class="ruby-string">'f'</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- columns-source -->
          
        </div>

        

        
      </div><!-- columns-method -->

    
      <div id="method-i-commit_db_transaction" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">commit_db_transaction</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Commits a transaction.</p>
          

          
          <div class="method-source-code" id="commit_db_transaction-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 707</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">commit_db_transaction</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-string">&quot;COMMIT&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- commit_db_transaction-source -->
          
        </div>

        

        
      </div><!-- commit_db_transaction-method -->

    
      <div id="method-i-create_database" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">create_database</span><span
            class="method-args">(name, options = {})</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Create a new PostgreSQL database. Options include <code>:owner</code>,
<code>:template</code>, <code>:encoding</code>, <code>:tablespace</code>,
and <code>:connection_limit</code> (note that MySQL uses
<code>:charset</code> while PostgreSQL uses <code>:encoding</code>).</p>

<p>Example:</p>

<pre class="ruby"><span class="ruby-identifier">create_database</span> <span class="ruby-identifier">config</span>[:<span class="ruby-identifier">database</span>], <span class="ruby-identifier">config</span>
<span class="ruby-identifier">create_database</span> <span class="ruby-string">'foo_development'</span>, :<span class="ruby-identifier">encoding</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">'unicode'</span>
</pre>
          

          
          <div class="method-source-code" id="create_database-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 748</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_database</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">options</span> = {})
  <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge</span>(<span class="ruby-value">:encoding</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-string">&quot;utf8&quot;</span>)

  <span class="ruby-identifier">option_string</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">symbolize_keys</span>.<span class="ruby-identifier">sum</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">key</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">|</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">key</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:owner</span>
      <span class="ruby-node">&quot; OWNER = \&quot;#{value}\&quot;&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:template</span>
      <span class="ruby-node">&quot; TEMPLATE = \&quot;#{value}\&quot;&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:encoding</span>
      <span class="ruby-node">&quot; ENCODING = '#{value}'&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:tablespace</span>
      <span class="ruby-node">&quot; TABLESPACE = \&quot;#{value}\&quot;&quot;</span>
    <span class="ruby-keyword">when</span> <span class="ruby-value">:connection_limit</span>
      <span class="ruby-node">&quot; CONNECTION LIMIT = #{value}&quot;</span>
    <span class="ruby-keyword">else</span>
      <span class="ruby-string">&quot;&quot;</span>
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;CREATE DATABASE #{quote_table_name(name)}#{option_string}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- create_database-source -->
          
        </div>

        

        
      </div><!-- create_database-method -->

    
      <div id="method-i-create_savepoint" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">create_savepoint</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="create_savepoint-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 720</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">create_savepoint</span>
  <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;SAVEPOINT #{current_savepoint_name}&quot;</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- create_savepoint-source -->
          
        </div>

        

        
      </div><!-- create_savepoint-method -->

    
      <div id="method-i-current_database" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">current_database</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the current database name.</p>
          

          
          <div class="method-source-code" id="current_database-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 865</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">current_database</span>
  <span class="ruby-identifier">query</span>(<span class="ruby-string">'select current_database()'</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- current_database-source -->
          
        </div>

        

        
      </div><!-- current_database-method -->

    
      <div id="method-i-current_schema" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">current_schema</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the current schema name.</p>
          

          
          <div class="method-source-code" id="current_schema-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 870</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">current_schema</span>
  <span class="ruby-identifier">query</span>(<span class="ruby-string">'SELECT current_schema'</span>, <span class="ruby-string">'SCHEMA'</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- current_schema-source -->
          
        </div>

        

        
      </div><!-- current_schema-method -->

    
      <div id="method-i-disconnect-21" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">disconnect!</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Disconnects from the database if already connected. Otherwise, this method
does nothing.</p>
          

          
          <div class="method-source-code" id="disconnect-21-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 367</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">disconnect!</span>
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">close</span> <span class="ruby-keyword">rescue</span> <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- disconnect-21-source -->
          
        </div>

        

        
      </div><!-- disconnect-21-method -->

    
      <div id="method-i-encoding" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">encoding</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the current database encoding format.</p>
          

          
          <div class="method-source-code" id="encoding-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 875</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">encoding</span>
        <span class="ruby-identifier">query</span>(<span class="ruby-string">&quot;          SELECT pg_encoding_to_char(pg_database.encoding) FROM pg_database
          WHERE pg_database.datname LIKE '#{current_database}'
&quot;</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
      <span class="ruby-keyword">end</span></pre>
          </div><!-- encoding-source -->
          
        </div>

        

        
      </div><!-- encoding-method -->

    
      <div id="method-i-escape_bytea" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">escape_bytea</span><span
            class="method-args">(value)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Escapes binary strings for bytea input to the database.</p>
          

          
          <div class="method-source-code" id="escape_bytea-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 420</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">escape_bytea</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">escape_bytea</span>(<span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- escape_bytea-source -->
          
        </div>

        

        
      </div><!-- escape_bytea-method -->

    
      <div id="method-i-exec_delete" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">exec_delete</span><span
            class="method-args">(sql, name = 'SQL', binds = [])</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="exec_delete-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 673</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_delete</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-string">'SQL'</span>, <span class="ruby-identifier">binds</span> = [])
  <span class="ruby-identifier">log</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">binds</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-identifier">binds</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">exec_no_cache</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">binds</span>) <span class="ruby-operator">:</span>
                            <span class="ruby-identifier">exec_cache</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">binds</span>)
    <span class="ruby-identifier">affected</span> = <span class="ruby-identifier">result</span>.<span class="ruby-identifier">cmd_tuples</span>
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">clear</span>
    <span class="ruby-identifier">affected</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- exec_delete-source -->
          
        </div>

        
        <div class="aliases">
          Also aliased as: <a href="PostgreSQLAdapter.html#method-i-exec_update">exec_update</a>
        </div>
        

        
      </div><!-- exec_delete-method -->

    
      <div id="method-i-exec_query" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">exec_query</span><span
            class="method-args">(sql, name = 'SQL', binds = [])</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="exec_query-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 662</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">exec_query</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-string">'SQL'</span>, <span class="ruby-identifier">binds</span> = [])
  <span class="ruby-identifier">log</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span>, <span class="ruby-identifier">binds</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-identifier">result</span> = <span class="ruby-identifier">binds</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-identifier">exec_no_cache</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">binds</span>) <span class="ruby-operator">:</span>
                            <span class="ruby-identifier">exec_cache</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">binds</span>)

    <span class="ruby-identifier">ret</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Result</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">result</span>.<span class="ruby-identifier">fields</span>, <span class="ruby-identifier">result_as_array</span>(<span class="ruby-identifier">result</span>))
    <span class="ruby-identifier">result</span>.<span class="ruby-identifier">clear</span>
    <span class="ruby-keyword">return</span> <span class="ruby-identifier">ret</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- exec_query-source -->
          
        </div>

        

        
      </div><!-- exec_query-method -->

    
      <div id="method-i-exec_update" class="method-detail method-alias">
        
        <div class="method-heading">
          <span class="method-name">exec_update</span><span
            class="method-args">(sql, name = 'SQL', binds = [])</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
        </div>

        

        
        <div class="aliases">
          Alias for: <a href="PostgreSQLAdapter.html#method-i-exec_delete">exec_delete</a>
        </div>
        
      </div><!-- exec_update-method -->

    
      <div id="method-i-execute" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">execute</span><span
            class="method-args">(sql, name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Executes an SQL statement, returning a PGresult object on success or
raising a PGError exception otherwise.</p>
          

          
          <div class="method-source-code" id="execute-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 652</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">execute</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">log</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span>) <span class="ruby-keyword">do</span>
    <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">async_exec</span>(<span class="ruby-identifier">sql</span>)
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- execute-source -->
          
        </div>

        

        
      </div><!-- execute-method -->

    
      <div id="method-i-explain" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">explain</span><span
            class="method-args">(arel, binds = [])</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>DATABASE STATEMENTS ======================================</p>
          

          
          <div class="method-source-code" id="explain-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 536</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">explain</span>(<span class="ruby-identifier">arel</span>, <span class="ruby-identifier">binds</span> = [])
  <span class="ruby-identifier">sql</span> = <span class="ruby-node">&quot;EXPLAIN #{to_sql(arel, binds)}&quot;</span>
  <span class="ruby-constant">ExplainPrettyPrinter</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">pp</span>(<span class="ruby-identifier">exec_query</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-string">'EXPLAIN'</span>, <span class="ruby-identifier">binds</span>))
<span class="ruby-keyword">end</span></pre>
          </div><!-- explain-source -->
          
        </div>

        

        
      </div><!-- explain-method -->

    
      <div id="method-i-index_name_length" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">index_name_length</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="index_name_length-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1072</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">index_name_length</span>
  <span class="ruby-value">63</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- index_name_length-source -->
          
        </div>

        

        
      </div><!-- index_name_length-method -->

    
      <div id="method-i-indexes" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">indexes</span><span
            class="method-args">(table_name, name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns an array of indexes for the given table.</p>
          

          
          <div class="method-source-code" id="indexes-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 818</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">indexes</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
         <span class="ruby-identifier">result</span> = <span class="ruby-identifier">query</span>(<span class="ruby-string">&quot;           SELECT distinct i.relname, d.indisunique, d.indkey, pg_get_indexdef(d.indexrelid), t.oid
           FROM pg_class t
           INNER JOIN pg_index d ON t.oid = d.indrelid
           INNER JOIN pg_class i ON d.indexrelid = i.oid
           WHERE i.relkind = 'i'
             AND d.indisprimary = 'f'
             AND t.relname = '#{table_name}'
             AND i.relnamespace IN (SELECT oid FROM pg_namespace WHERE nspname = ANY (current_schemas(false)) )
          ORDER BY i.relname
&quot;</span>, <span class="ruby-identifier">name</span>)


        <span class="ruby-identifier">result</span>.<span class="ruby-identifier">map</span> <span class="ruby-keyword">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">index_name</span> = <span class="ruby-identifier">row</span>[<span class="ruby-value">0</span>]
          <span class="ruby-identifier">unique</span> = <span class="ruby-identifier">row</span>[<span class="ruby-value">1</span>] <span class="ruby-operator">==</span> <span class="ruby-string">'t'</span>
          <span class="ruby-identifier">indkey</span> = <span class="ruby-identifier">row</span>[<span class="ruby-value">2</span>].<span class="ruby-identifier">split</span>(<span class="ruby-string">&quot; &quot;</span>)
          <span class="ruby-identifier">inddef</span> = <span class="ruby-identifier">row</span>[<span class="ruby-value">3</span>]
          <span class="ruby-identifier">oid</span> = <span class="ruby-identifier">row</span>[<span class="ruby-value">4</span>]

          <span class="ruby-identifier">columns</span> = <span class="ruby-constant">Hash</span>[<span class="ruby-identifier">query</span>(<span class="ruby-string">&quot;          SELECT a.attnum, a.attname
          FROM pg_attribute a
          WHERE a.attrelid = #{oid}
          AND a.attnum IN (#{indkey.join(&quot;,&quot;)})
&quot;</span>, <span class="ruby-node">&quot;Columns for index #{row[0]} on #{table_name}&quot;</span>)]

          <span class="ruby-identifier">column_names</span> = <span class="ruby-identifier">columns</span>.<span class="ruby-identifier">values_at</span>(*<span class="ruby-identifier">indkey</span>).<span class="ruby-identifier">compact</span>

          <span class="ruby-comment"># add info on sort order for columns (only desc order is explicitly specified, asc is the default)</span>
          <span class="ruby-identifier">desc_order_columns</span> = <span class="ruby-identifier">inddef</span>.<span class="ruby-identifier">scan</span>(<span class="ruby-regexp">%r(\w+) DESC/</span>).<span class="ruby-identifier">flatten</span>
          <span class="ruby-identifier">orders</span> = <span class="ruby-identifier">desc_order_columns</span>.<span class="ruby-identifier">any?</span> <span class="ruby-operator">?</span> <span class="ruby-constant">Hash</span>[<span class="ruby-identifier">desc_order_columns</span>.<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">order_column</span><span class="ruby-operator">|</span> [<span class="ruby-identifier">order_column</span>, <span class="ruby-value">:desc</span>]}] <span class="ruby-operator">:</span> {}
      
          <span class="ruby-identifier">column_names</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">nil</span> <span class="ruby-operator">:</span> <span class="ruby-constant">IndexDefinition</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">index_name</span>, <span class="ruby-identifier">unique</span>, <span class="ruby-identifier">column_names</span>, [], <span class="ruby-identifier">orders</span>)
        <span class="ruby-keyword">end</span>.<span class="ruby-identifier">compact</span>
      <span class="ruby-keyword">end</span></pre>
          </div><!-- indexes-source -->
          
        </div>

        

        
      </div><!-- indexes-method -->

    
      <div id="method-i-insert_sql" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">insert_sql</span><span
            class="method-args">(sql, name = nil, pk = nil, id_value = nil, sequence_name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Executes an INSERT query and returns the new record’s ID</p>
          

          
          <div class="method-source-code" id="insert_sql-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 585</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_sql</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">pk</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">id_value</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">sequence_name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">pk</span>
    <span class="ruby-comment"># Extract the table from the insert sql. Yuck.</span>
    <span class="ruby-identifier">table_ref</span> = <span class="ruby-identifier">extract_table_ref_from_insert_sql</span>(<span class="ruby-identifier">sql</span>)
    <span class="ruby-identifier">pk</span> = <span class="ruby-identifier">primary_key</span>(<span class="ruby-identifier">table_ref</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">table_ref</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-keyword">if</span> <span class="ruby-identifier">pk</span>
    <span class="ruby-identifier">select_value</span>(<span class="ruby-node">&quot;#{sql} RETURNING #{quote_column_name(pk)}&quot;</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- insert_sql-source -->
          
        </div>

        

        
      </div><!-- insert_sql-method -->

    
      <div id="method-i-outside_transaction-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">outside_transaction?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="outside_transaction-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 716</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">outside_transaction?</span>
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">transaction_status</span> <span class="ruby-operator">==</span> <span class="ruby-constant">PGconn</span><span class="ruby-operator">::</span><span class="ruby-constant">PQTRANS_IDLE</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- outside_transaction-3F-source -->
          
        </div>

        

        
      </div><!-- outside_transaction-3F-method -->

    
      <div id="method-i-primary_key" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">primary_key</span><span
            class="method-args">(table)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns just a table’s primary key</p>
          

          
          <div class="method-source-code" id="primary_key-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 994</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">primary_key</span>(<span class="ruby-identifier">table</span>)
        <span class="ruby-identifier">row</span> = <span class="ruby-identifier">exec_query</span>(<span class="ruby-string">&quot;          SELECT DISTINCT(attr.attname)
          FROM pg_attribute attr
          INNER JOIN pg_depend dep ON attr.attrelid = dep.refobjid AND attr.attnum = dep.refobjsubid
          INNER JOIN pg_constraint cons ON attr.attrelid = cons.conrelid AND attr.attnum = cons.conkey[1]
          WHERE cons.contype = 'p'
            AND dep.refobjid = $1::regclass
&quot;</span>, <span class="ruby-string">'SCHEMA'</span>, [[<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">table</span>]]).<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">first</span>

        <span class="ruby-identifier">row</span> <span class="ruby-operator">&amp;&amp;</span> <span class="ruby-identifier">row</span>.<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">end</span></pre>
          </div><!-- primary_key-source -->
          
        </div>

        

        
      </div><!-- primary_key-method -->

    
      <div id="method-i-quote_table_name" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">quote_table_name</span><span
            class="method-args">(name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Checks the following cases:</p>
<ul><li>
<p>table_name</p>
</li><li>
<p>“table.name”</p>
</li><li>
<p>schema_name.table_name</p>
</li><li>
<p>schema_name.“table.name”</p>
</li><li>
<p>“schema.name”.table_name</p>
</li><li>
<p>“schema.name”.“table.name”</p>
</li></ul>
          

          
          <div class="method-source-code" id="quote_table_name-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 485</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">quote_table_name</span>(<span class="ruby-identifier">name</span>)
  <span class="ruby-identifier">schema</span>, <span class="ruby-identifier">name_part</span> = <span class="ruby-identifier">extract_pg_identifier_from_name</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)

  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">name_part</span>
    <span class="ruby-identifier">quote_column_name</span>(<span class="ruby-identifier">schema</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">name_part</span> = <span class="ruby-identifier">extract_pg_identifier_from_name</span>(<span class="ruby-identifier">name_part</span>)
    <span class="ruby-node">&quot;#{quote_column_name(schema)}.#{quote_column_name(table_name)}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- quote_table_name-source -->
          
        </div>

        

        
      </div><!-- quote_table_name-method -->

    
      <div id="method-i-reconnect-21" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">reconnect!</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Close then reopen the connection.</p>
          

          
          <div class="method-source-code" id="reconnect-21-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 354</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">reconnect!</span>
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">reset</span>
  <span class="ruby-identifier">configure_connection</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- reconnect-21-source -->
          
        </div>

        

        
      </div><!-- reconnect-21-method -->

    
      <div id="method-i-release_savepoint" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">release_savepoint</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="release_savepoint-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 728</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">release_savepoint</span>
  <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;RELEASE SAVEPOINT #{current_savepoint_name}&quot;</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- release_savepoint-source -->
          
        </div>

        

        
      </div><!-- release_savepoint-method -->

    
      <div id="method-i-rename_column" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">rename_column</span><span
            class="method-args">(table_name, column_name, new_column_name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Renames a column in a table.</p>
          

          
          <div class="method-source-code" id="rename_column-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1059</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rename_column</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">column_name</span>, <span class="ruby-identifier">new_column_name</span>)
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(table_name)} RENAME COLUMN #{quote_column_name(column_name)} TO #{quote_column_name(new_column_name)}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- rename_column-source -->
          
        </div>

        

        
      </div><!-- rename_column-method -->

    
      <div id="method-i-rename_index" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">rename_index</span><span
            class="method-args">(table_name, old_name, new_name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="rename_index-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1068</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rename_index</span>(<span class="ruby-identifier">table_name</span>, <span class="ruby-identifier">old_name</span>, <span class="ruby-identifier">new_name</span>)
  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER INDEX #{quote_column_name(old_name)} RENAME TO #{quote_table_name(new_name)}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- rename_index-source -->
          
        </div>

        

        
      </div><!-- rename_index-method -->

    
      <div id="method-i-rename_table" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">rename_table</span><span
            class="method-args">(name, new_name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Renames a table. Also renames a table’s primary key sequence if the
sequence name matches the Active Record default.</p>

<p>Example:</p>

<pre>rename_table('octopuses', 'octopi')</pre>
          

          
          <div class="method-source-code" id="rename_table-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1013</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rename_table</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">new_name</span>)
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(name)} RENAME TO #{quote_table_name(new_name)}&quot;</span>
  <span class="ruby-identifier">pk</span>, <span class="ruby-identifier">seq</span> = <span class="ruby-identifier">pk_and_sequence_for</span>(<span class="ruby-identifier">new_name</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">seq</span> <span class="ruby-operator">==</span> <span class="ruby-node">&quot;#{name}_#{pk}_seq&quot;</span>
    <span class="ruby-identifier">new_seq</span> = <span class="ruby-node">&quot;#{new_name}_#{pk}_seq&quot;</span>
    <span class="ruby-identifier">execute</span> <span class="ruby-node">&quot;ALTER TABLE #{quote_table_name(seq)} RENAME TO #{quote_table_name(new_seq)}&quot;</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- rename_table-source -->
          
        </div>

        

        
      </div><!-- rename_table-method -->

    
      <div id="method-i-reset-21" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">reset!</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="reset-21-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 360</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">reset!</span>
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-keyword">super</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- reset-21-source -->
          
        </div>

        

        
      </div><!-- reset-21-method -->

    
      <div id="method-i-rollback_db_transaction" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">rollback_db_transaction</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Aborts a transaction.</p>
          

          
          <div class="method-source-code" id="rollback_db_transaction-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 712</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rollback_db_transaction</span>
  <span class="ruby-identifier">execute</span> <span class="ruby-string">&quot;ROLLBACK&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- rollback_db_transaction-source -->
          
        </div>

        

        
      </div><!-- rollback_db_transaction-method -->

    
      <div id="method-i-rollback_to_savepoint" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">rollback_to_savepoint</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="rollback_to_savepoint-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 724</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">rollback_to_savepoint</span>
  <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;ROLLBACK TO SAVEPOINT #{current_savepoint_name}&quot;</span>)
<span class="ruby-keyword">end</span></pre>
          </div><!-- rollback_to_savepoint-source -->
          
        </div>

        

        
      </div><!-- rollback_to_savepoint-method -->

    
      <div id="method-i-schema_exists-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">schema_exists?</span><span
            class="method-args">(name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns true if schema exists.</p>
          

          
          <div class="method-source-code" id="schema_exists-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 809</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">schema_exists?</span>(<span class="ruby-identifier">name</span>)
        <span class="ruby-identifier">exec_query</span>(<span class="ruby-string">&quot;          SELECT COUNT(*)
          FROM pg_namespace
          WHERE nspname = $1
&quot;</span>, <span class="ruby-string">'SCHEMA'</span>, [[<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">name</span>]]).<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-keyword">end</span></pre>
          </div><!-- schema_exists-3F-source -->
          
        </div>

        

        
      </div><!-- schema_exists-3F-method -->

    
      <div id="method-i-schema_search_path" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">schema_search_path</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the active schema search path.</p>
          

          
          <div class="method-source-code" id="schema_search_path-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 895</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">schema_search_path</span>
  <span class="ruby-ivar">@schema_search_path</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">query</span>(<span class="ruby-string">'SHOW search_path'</span>, <span class="ruby-string">'SCHEMA'</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- schema_search_path-source -->
          
        </div>

        

        
      </div><!-- schema_search_path-method -->

    
      <div id="method-i-schema_search_path-3D" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">schema_search_path=</span><span
            class="method-args">(schema_csv)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Sets the schema search path to a string of comma-separated schema names.
Names beginning with $ have to be quoted (e.g. $user =&gt; ‘$user’). See:
<a
href="http://www.postgresql.org/docs/current/static/ddl-schemas.html">www.postgresql.org/docs/current/static/ddl-schemas.html</a></p>

<p>This should be not be called manually but set in database.yml.</p>
          

          
          <div class="method-source-code" id="schema_search_path-3D-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 887</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">schema_search_path=</span>(<span class="ruby-identifier">schema_csv</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">schema_csv</span>
    <span class="ruby-identifier">execute</span>(<span class="ruby-node">&quot;SET search_path TO #{schema_csv}&quot;</span>, <span class="ruby-string">'SCHEMA'</span>)
    <span class="ruby-ivar">@schema_search_path</span> = <span class="ruby-identifier">schema_csv</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- schema_search_path-3D-source -->
          
        </div>

        

        
      </div><!-- schema_search_path-3D-method -->

    
      <div id="method-i-select_rows" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">select_rows</span><span
            class="method-args">(sql, name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Executes a SELECT query and returns an array of rows. Each row is an array
of field values.</p>
          

          
          <div class="method-source-code" id="select_rows-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 580</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">select_rows</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-identifier">select_raw</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span>).<span class="ruby-identifier">last</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- select_rows-source -->
          
        </div>

        

        
      </div><!-- select_rows-method -->

    
      <div id="method-i-serial_sequence" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">serial_sequence</span><span
            class="method-args">(table, column)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="serial_sequence-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 916</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">serial_sequence</span>(<span class="ruby-identifier">table</span>, <span class="ruby-identifier">column</span>)
        <span class="ruby-identifier">result</span> = <span class="ruby-identifier">exec_query</span>(<span class="ruby-string">&quot;          SELECT pg_get_serial_sequence($1, $2)
&quot;</span>, <span class="ruby-string">'SCHEMA'</span>, [[<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">table</span>], [<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">column</span>]])
        <span class="ruby-identifier">result</span>.<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">first</span>.<span class="ruby-identifier">first</span>
      <span class="ruby-keyword">end</span></pre>
          </div><!-- serial_sequence-source -->
          
        </div>

        

        
      </div><!-- serial_sequence-method -->

    
      <div id="method-i-session_auth-3D" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">session_auth=</span><span
            class="method-args">(user)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Set the authorized user for this session</p>
          

          
          <div class="method-source-code" id="session_auth-3D-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 512</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">session_auth=</span>(<span class="ruby-identifier">user</span>)
  <span class="ruby-identifier">clear_cache!</span>
  <span class="ruby-identifier">exec_query</span> <span class="ruby-node">&quot;SET SESSION AUTHORIZATION #{user}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- session_auth-3D-source -->
          
        </div>

        

        
      </div><!-- session_auth-3D-method -->

    
      <div id="method-i-set_standard_conforming_strings" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">set_standard_conforming_strings</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Enable standard-conforming strings if available.</p>
          

          
          <div class="method-source-code" id="set_standard_conforming_strings-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 387</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">set_standard_conforming_strings</span>
  <span class="ruby-identifier">old</span>, <span class="ruby-keyword">self</span>.<span class="ruby-identifier">client_min_messages</span> = <span class="ruby-identifier">client_min_messages</span>, <span class="ruby-string">'panic'</span>
  <span class="ruby-identifier">execute</span>(<span class="ruby-string">'SET standard_conforming_strings = on'</span>, <span class="ruby-string">'SCHEMA'</span>) <span class="ruby-keyword">rescue</span> <span class="ruby-keyword">nil</span>
<span class="ruby-keyword">ensure</span>
  <span class="ruby-keyword">self</span>.<span class="ruby-identifier">client_min_messages</span> = <span class="ruby-identifier">old</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- set_standard_conforming_strings-source -->
          
        </div>

        

        
      </div><!-- set_standard_conforming_strings-method -->

    
      <div id="method-i-sql_for_insert" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">sql_for_insert</span><span
            class="method-args">(sql, pk, id_value, sequence_name, binds)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="sql_for_insert-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 684</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">sql_for_insert</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">pk</span>, <span class="ruby-identifier">id_value</span>, <span class="ruby-identifier">sequence_name</span>, <span class="ruby-identifier">binds</span>)
  <span class="ruby-keyword">unless</span> <span class="ruby-identifier">pk</span>
    <span class="ruby-comment"># Extract the table from the insert sql. Yuck.</span>
    <span class="ruby-identifier">table_ref</span> = <span class="ruby-identifier">extract_table_ref_from_insert_sql</span>(<span class="ruby-identifier">sql</span>)
    <span class="ruby-identifier">pk</span> = <span class="ruby-identifier">primary_key</span>(<span class="ruby-identifier">table_ref</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">table_ref</span>
  <span class="ruby-keyword">end</span>

  <span class="ruby-identifier">sql</span> = <span class="ruby-node">&quot;#{sql} RETURNING #{quote_column_name(pk)}&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">pk</span>

  [<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">binds</span>]
<span class="ruby-keyword">end</span></pre>
          </div><!-- sql_for_insert-source -->
          
        </div>

        

        
      </div><!-- sql_for_insert-method -->

    
      <div id="method-i-substitute_at" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">substitute_at</span><span
            class="method-args">(column, index)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="substitute_at-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 658</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">substitute_at</span>(<span class="ruby-identifier">column</span>, <span class="ruby-identifier">index</span>)
  <span class="ruby-constant">Arel</span><span class="ruby-operator">::</span><span class="ruby-constant">Nodes</span><span class="ruby-operator">::</span><span class="ruby-constant">BindParam</span>.<span class="ruby-identifier">new</span> <span class="ruby-node">&quot;$#{index + 1}&quot;</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- substitute_at-source -->
          
        </div>

        

        
      </div><!-- substitute_at-method -->

    
      <div id="method-i-supports_ddl_transactions-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_ddl_transactions?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="supports_ddl_transactions-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 398</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_ddl_transactions?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_ddl_transactions-3F-source -->
          
        </div>

        

        
      </div><!-- supports_ddl_transactions-3F-method -->

    
      <div id="method-i-supports_explain-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_explain?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns true.</p>
          

          
          <div class="method-source-code" id="supports_explain-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 408</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_explain?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_explain-3F-source -->
          
        </div>

        

        
      </div><!-- supports_explain-3F-method -->

    
      <div id="method-i-supports_index_sort_order-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_index_sort_order?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="supports_index_sort_order-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 251</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_index_sort_order?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_index_sort_order-3F-source -->
          
        </div>

        

        
      </div><!-- supports_index_sort_order-3F-method -->

    
      <div id="method-i-supports_insert_with_returning-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_insert_with_returning?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="supports_insert_with_returning-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 394</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_insert_with_returning?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_insert_with_returning-3F-source -->
          
        </div>

        

        
      </div><!-- supports_insert_with_returning-3F-method -->

    
      <div id="method-i-supports_migrations-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_migrations?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns true, since this connection adapter supports migrations.</p>
          

          
          <div class="method-source-code" id="supports_migrations-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 377</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_migrations?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_migrations-3F-source -->
          
        </div>

        

        
      </div><!-- supports_migrations-3F-method -->

    
      <div id="method-i-supports_savepoints-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_savepoints?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns true, since this connection adapter supports savepoints.</p>
          

          
          <div class="method-source-code" id="supports_savepoints-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 403</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_savepoints?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_savepoints-3F-source -->
          
        </div>

        

        
      </div><!-- supports_savepoints-3F-method -->

    
      <div id="method-i-supports_statement_cache-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">supports_statement_cache?</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns <code>true</code>, since this connection adapter supports prepared
statement caching.</p>
          

          
          <div class="method-source-code" id="supports_statement_cache-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 247</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">supports_statement_cache?</span>
  <span class="ruby-keyword">true</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- supports_statement_cache-3F-source -->
          
        </div>

        

        
      </div><!-- supports_statement_cache-3F-method -->

    
      <div id="method-i-table_alias_length" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">table_alias_length</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the configured supported identifier length supported by PostgreSQL</p>
          

          
          <div class="method-source-code" id="table_alias_length-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 413</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">table_alias_length</span>
  <span class="ruby-ivar">@table_alias_length</span> <span class="ruby-operator">||=</span> <span class="ruby-identifier">query</span>(<span class="ruby-string">'SHOW max_identifier_length'</span>)[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- table_alias_length-source -->
          
        </div>

        

        
      </div><!-- table_alias_length-method -->

    
      <div id="method-i-table_exists-3F" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">table_exists?</span><span
            class="method-args">(name)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns true if table exists. If the schema is not specified as part of
<code>name</code> then it will only find tables within the current schema
search path (regardless of permissions to access tables in other schemas)</p>
          

          
          <div class="method-source-code" id="table_exists-3F-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 791</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">table_exists?</span>(<span class="ruby-identifier">name</span>)
        <span class="ruby-identifier">schema</span>, <span class="ruby-identifier">table</span> = <span class="ruby-constant">Utils</span>.<span class="ruby-identifier">extract_schema_and_table</span>(<span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_s</span>)
        <span class="ruby-keyword">return</span> <span class="ruby-keyword">false</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">table</span>

        <span class="ruby-identifier">binds</span> = [[<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">table</span>]]
        <span class="ruby-identifier">binds</span> <span class="ruby-operator">&lt;&lt;</span> [<span class="ruby-keyword">nil</span>, <span class="ruby-identifier">schema</span>] <span class="ruby-keyword">if</span> <span class="ruby-identifier">schema</span>

        <span class="ruby-identifier">exec_query</span>(<span class="ruby-string">&quot;            SELECT COUNT(*)
            FROM pg_class c
            LEFT JOIN pg_namespace n ON n.oid = c.relnamespace
            WHERE c.relkind in ('v','r')
            AND c.relname = $1
            AND n.nspname = #{schema ? '$2' : 'ANY (current_schemas(false))'}
&quot;</span>, <span class="ruby-string">'SCHEMA'</span>, <span class="ruby-identifier">binds</span>).<span class="ruby-identifier">rows</span>.<span class="ruby-identifier">first</span>[<span class="ruby-value">0</span>].<span class="ruby-identifier">to_i</span> <span class="ruby-operator">&gt;</span> <span class="ruby-value">0</span>
      <span class="ruby-keyword">end</span></pre>
          </div><!-- table_exists-3F-source -->
          
        </div>

        

        
      </div><!-- table_exists-3F-method -->

    
      <div id="method-i-tables" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">tables</span><span
            class="method-args">(name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the list of all tables in the schema search path or a specified
schema.</p>
          

          
          <div class="method-source-code" id="tables-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 780</span>
      <span class="ruby-keyword">def</span> <span class="ruby-identifier">tables</span>(<span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
        <span class="ruby-identifier">query</span>(<span class="ruby-string">&quot;          SELECT tablename
          FROM pg_tables
          WHERE schemaname = ANY (current_schemas(false))
&quot;</span>, <span class="ruby-string">'SCHEMA'</span>).<span class="ruby-identifier">map</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">row</span><span class="ruby-operator">|</span> <span class="ruby-identifier">row</span>[<span class="ruby-value">0</span>] }
      <span class="ruby-keyword">end</span></pre>
          </div><!-- tables-source -->
          
        </div>

        

        
      </div><!-- tables-method -->

    
      <div id="method-i-type_cast" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">type_cast</span><span
            class="method-args">(value, column)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="type_cast-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 460</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">type_cast</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">column</span>)
  <span class="ruby-keyword">return</span> <span class="ruby-keyword">super</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">column</span>

  <span class="ruby-keyword">case</span> <span class="ruby-identifier">value</span>
  <span class="ruby-keyword">when</span> <span class="ruby-constant">String</span>
    <span class="ruby-keyword">return</span> <span class="ruby-keyword">super</span> <span class="ruby-keyword">unless</span> <span class="ruby-string">'bytea'</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">column</span>.<span class="ruby-identifier">sql_type</span>
    { <span class="ruby-value">:value</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">value</span>, <span class="ruby-value">:format</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value">1</span> }
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- type_cast-source -->
          
        </div>

        

        
      </div><!-- type_cast-method -->

    
      <div id="method-i-type_to_sql" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">type_to_sql</span><span
            class="method-args">(type, limit = nil, precision = nil, scale = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Maps logical <a href="../../Rails.html">Rails</a> types to
PostgreSQL-specific data types.</p>
          

          
          <div class="method-source-code" id="type_to_sql-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1077</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">type_to_sql</span>(<span class="ruby-identifier">type</span>, <span class="ruby-identifier">limit</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">precision</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-identifier">scale</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">type</span>.<span class="ruby-identifier">to_s</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">'binary'</span>
    <span class="ruby-comment"># PostgreSQL doesn't support limits on binary (bytea) columns.</span>
    <span class="ruby-comment"># The hard limit is 1Gb, because of a 32-bit size field, and TOAST.</span>
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">limit</span>
    <span class="ruby-keyword">when</span> <span class="ruby-keyword">nil</span>, <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">0x3fffffff</span>; <span class="ruby-keyword">super</span>(<span class="ruby-identifier">type</span>)
    <span class="ruby-keyword">else</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">ActiveRecordError</span>, <span class="ruby-node">&quot;No binary type has byte size #{limit}.&quot;</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">when</span> <span class="ruby-string">'integer'</span>
    <span class="ruby-keyword">return</span> <span class="ruby-string">'integer'</span> <span class="ruby-keyword">unless</span> <span class="ruby-identifier">limit</span>
  
    <span class="ruby-keyword">case</span> <span class="ruby-identifier">limit</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">1</span>, <span class="ruby-value">2</span>; <span class="ruby-string">'smallint'</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">3</span>, <span class="ruby-value">4</span>; <span class="ruby-string">'integer'</span>
      <span class="ruby-keyword">when</span> <span class="ruby-value">5</span><span class="ruby-operator">..</span><span class="ruby-value">8</span>; <span class="ruby-string">'bigint'</span>
      <span class="ruby-keyword">else</span> <span class="ruby-identifier">raise</span>(<span class="ruby-constant">ActiveRecordError</span>, <span class="ruby-node">&quot;No integer type has byte size #{limit}. Use a numeric with precision 0 instead.&quot;</span>)
    <span class="ruby-keyword">end</span>
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- type_to_sql-source -->
          
        </div>

        

        
      </div><!-- type_to_sql-method -->

    
      <div id="method-i-unescape_bytea" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">unescape_bytea</span><span
            class="method-args">(value)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Unescapes bytea output from a database to the binary string it represents.
NOTE: This is NOT an inverse of <a
href="PostgreSQLAdapter.html#method-i-escape_bytea">#escape_bytea</a>! This
is only to be used</p>

<pre>on escaped binary output from database drive.</pre>
          

          
          <div class="method-source-code" id="unescape_bytea-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 427</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">unescape_bytea</span>(<span class="ruby-identifier">value</span>)
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">unescape_bytea</span>(<span class="ruby-identifier">value</span>) <span class="ruby-keyword">if</span> <span class="ruby-identifier">value</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- unescape_bytea-source -->
          
        </div>

        

        
      </div><!-- unescape_bytea-method -->

    
      <div id="method-i-update_sql" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">update_sql</span><span
            class="method-args">(sql, name = nil)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Executes an UPDATE query and returns the number of affected tuples.</p>
          

          
          <div class="method-source-code" id="update_sql-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 697</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">update_sql</span>(<span class="ruby-identifier">sql</span>, <span class="ruby-identifier">name</span> = <span class="ruby-keyword">nil</span>)
  <span class="ruby-keyword">super</span>.<span class="ruby-identifier">cmd_tuples</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- update_sql-source -->
          
        </div>

        

        
      </div><!-- update_sql-method -->

    
    </section><!-- public-instance-method-details -->
  
     <section id="protected-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Protected Instance Methods</h3>

    
      <div id="method-i-postgresql_version" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">postgresql_version</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          <p>Returns the version of the connected PostgreSQL server.</p>
          

          
          <div class="method-source-code" id="postgresql_version-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1139</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">postgresql_version</span>
  <span class="ruby-ivar">@connection</span>.<span class="ruby-identifier">server_version</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- postgresql_version-source -->
          
        </div>

        

        
      </div><!-- postgresql_version-method -->

    
      <div id="method-i-translate_exception" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">translate_exception</span><span
            class="method-args">(exception, message)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="translate_exception-source">
            <pre><span class="ruby-comment"># File /usr/local/lib/ruby/gems/1.9.1/gems/activerecord-3.2.7/lib/active_record/connection_adapters/postgresql_adapter.rb, line 1143</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">translate_exception</span>(<span class="ruby-identifier">exception</span>, <span class="ruby-identifier">message</span>)
  <span class="ruby-keyword">case</span> <span class="ruby-identifier">exception</span>.<span class="ruby-identifier">message</span>
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">%rduplicate key value violates unique constraint/</span>
    <span class="ruby-constant">RecordNotUnique</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">exception</span>)
  <span class="ruby-keyword">when</span> <span class="ruby-regexp">%rviolates foreign key constraint/</span>
    <span class="ruby-constant">InvalidForeignKey</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">message</span>, <span class="ruby-identifier">exception</span>)
  <span class="ruby-keyword">else</span>
    <span class="ruby-keyword">super</span>
  <span class="ruby-keyword">end</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- translate_exception-source -->
          
        </div>

        

        
      </div><!-- translate_exception-method -->

    
    </section><!-- protected-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

